mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 10:17:31 +00:00
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 bydf758880e2
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:df758880e2
("path: don't override "cache" and "state" paths with configdir")
This commit is contained in:
parent
0e5aa216b8
commit
084a8782e3
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user