diff options
author | wm4 <wm4@nowhere> | 2020-06-25 17:44:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-06-25 17:56:16 +0200 |
commit | c3694f0acb7f71daac7606fafbadcb7b500ca35e (patch) | |
tree | 92fc33fe5b2ee93318b0a9fefd9a4bcdfb0892af | |
parent | 269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0 (diff) | |
download | mpv-c3694f0acb7f71daac7606fafbadcb7b500ca35e.tar.bz2 mpv-c3694f0acb7f71daac7606fafbadcb7b500ca35e.tar.xz |
path: do not use old_home for win32 exe dir
Apparently mpv supports loading config files from the same directory as
the mpv.exe. This is a fallback of some sort. It used the old_home
mechanism.
I want to add a warning if old_home exists, but that would always show
the warning on win32. Obviously we don't want that.
Add a separate exe_dir entry to deal with that.
Untested, but probably works.
-rw-r--r-- | DOCS/man/mpv.rst | 2 | ||||
-rw-r--r-- | options/path.c | 1 | ||||
-rw-r--r-- | osdep/path-win.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index 8b87c37285..92c0052c55 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -438,6 +438,8 @@ Name Meaning ``~~global/`` the global config path, if available (not on win32) ``~~osxbundle/`` the OSX bundle resource path (OSX only) ``~~desktop/`` the path to the desktop (win32, OSX) +``~~exe_dir`` win32 only: the path to the directory containing the exe (for + config file purposes; ``$MPV_HOME`` overrides it) ``~~old_home`` do not use ================ =============================================================== diff --git a/options/path.c b/options/path.c index 9c996ce664..7afa3c1dc0 100644 --- a/options/path.c +++ b/options/path.c @@ -59,6 +59,7 @@ static const char *const config_dirs[] = { "home", "old_home", "osxbundle", + "exe_dir" "global", }; diff --git a/osdep/path-win.c b/osdep/path-win.c index 8f289ff83a..78e83c2222 100644 --- a/osdep/path-win.c +++ b/osdep/path-win.c @@ -90,7 +90,7 @@ const char *mp_get_platform_path_win(void *talloc_ctx, const char *type) } else { if (strcmp(type, "home") == 0) return mp_get_win_app_dir(talloc_ctx); - if (strcmp(type, "old_home") == 0) + if (strcmp(type, "exe_dir") == 0) return mp_get_win_exe_dir(talloc_ctx); // Not really true, but serves as a way to return a lowest-priority dir. if (strcmp(type, "global") == 0) |