From 084a8782e39a80291817593c50f68633a2ab8ef0 Mon Sep 17 00:00:00 2001 From: llyyr Date: Mon, 4 Mar 2024 17:30:28 +0530 Subject: [PATCH] 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") --- options/path.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } }