diff options
Diffstat (limited to 'options/path.c')
-rw-r--r-- | options/path.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/options/path.c b/options/path.c index 08d16fe944..c5c374690a 100644 --- a/options/path.c +++ b/options/path.c @@ -76,10 +76,12 @@ static const char *mp_get_platform_path(void *talloc_ctx, const char *force_configdir = getenv("MPV_HOME"); if (global->opts->force_configdir && global->opts->force_configdir[0]) force_configdir = global->opts->force_configdir; + if (!global->opts->load_config) + force_configdir = ""; if (force_configdir) { for (int n = 0; n < MP_ARRAY_SIZE(config_dirs); n++) { if (strcmp(config_dirs[n], type) == 0) - return n == 0 ? force_configdir : NULL; + return (n == 0 && force_configdir[0]) ? force_configdir : NULL; } } @@ -257,6 +259,10 @@ char *mp_path_join(void *talloc_ctx, const char *p1, const char *p2) char *mp_getcwd(void *talloc_ctx) { + char *e_wd = getenv("PWD"); + if (e_wd) + return talloc_strdup(talloc_ctx, e_wd); + char *wd = talloc_array(talloc_ctx, char, 20); while (getcwd(wd, talloc_get_size(wd)) == NULL) { if (errno != ERANGE) { |