diff options
author | llyyr <llyyr@yukari.in> | 2024-03-04 17:30:28 +0530 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2024-03-11 21:29:46 +0100 |
commit | 084a8782e39a80291817593c50f68633a2ab8ef0 (patch) | |
tree | b637f932171f54423ba099b8182cbdf2715aa722 | |
parent | 0e5aa216b8c1c6e0ad2d82aa25f35bef42566cf3 (diff) | |
download | mpv-084a8782e39a80291817593c50f68633a2ab8ef0.tar.bz2 mpv-084a8782e39a80291817593c50f68633a2ab8ef0.tar.xz |
path: don't load any files if --no-config is passed
`--no-config` should prevent loading any user files, whether it be
config, cache, watch_later state etc. This functionality was changed by
df758880e26c because internally `--no-config` is equivalent to passing
`--config-dir=""` which resulted in cache and state being auto-detected
even if `--no-config` was passed.
Fixes: df758880e26c ("path: don't override "cache" and "state" paths with configdir")
-rw-r--r-- | options/path.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/options/path.c b/options/path.c index 7b212176b9..7c7d31c02f 100644 --- a/options/path.c +++ b/options/path.c @@ -76,10 +76,14 @@ static const char *mp_get_platform_path(void *talloc_ctx, assert(talloc_ctx); if (global->configdir) { + // Return NULL for all platform paths if --no-config is passed + if (!global->configdir[0]) + return NULL; + // force all others to NULL, only first returns the path for (int n = 0; n < MP_ARRAY_SIZE(config_dirs); n++) { if (strcmp(config_dirs[n], type) == 0) - return (n == 0 && global->configdir[0]) ? global->configdir : NULL; + return (n == 0) ? global->configdir : NULL; } } |