summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-05 15:33:19 +0200
committerwm4 <wm4@nowhere>2015-09-05 15:33:19 +0200
commit392ae68e5f802e940b7b7f5a139af7e2698b5e0e (patch)
tree1d7bf827311e0f5192c6ab06e5c21e3f55361c34 /options
parenta6694b7b96f94dd692b55e6db1a7740ddbe3fdee (diff)
downloadmpv-392ae68e5f802e940b7b7f5a139af7e2698b5e0e.tar.bz2
mpv-392ae68e5f802e940b7b7f5a139af7e2698b5e0e.tar.xz
options: fix --no-config
This was completely broken. It was checked manually in some config loading paths, so it appeared to work. But the intention was always to completely disable reading from the normal config dir. This logic was broken in commit 2263f37d. The manual checks are actually redundant, and are not needed if --no-config is implemented properly - remove them. Additionally, the change to load the libmpv defaults from an embedded profile also failed to set "config=no". The option is marked as not being settable by a config file, and the libmpv default profile is parsed as a config file, so this option was rejected. Fix it by removing the CONF_NOCFG flag. (Alternatively, m_config_set_profile() could be changed not to set the "config file" flag by default, but I'm not bothering with this.)
Diffstat (limited to 'options')
-rw-r--r--options/options.c2
-rw-r--r--options/path.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/options/options.c b/options/options.c
index 71aea336b1..45f4217a2e 100644
--- a/options/options.c
+++ b/options/options.c
@@ -132,7 +132,7 @@ const m_option_t mp_opts[] = {
{"belownormal", BELOW_NORMAL_PRIORITY_CLASS},
{"idle", IDLE_PRIORITY_CLASS})),
#endif
- OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE),
+ OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_PRE_PARSE),
OPT_STRING("config-dir", force_configdir,
CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE),
OPT_STRINGLIST("reset-on-next-file", reset_options, M_OPT_GLOBAL),
diff --git a/options/path.c b/options/path.c
index 08d16fe944..29ebcd9277 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;
}
}