summaryrefslogtreecommitdiffstats
path: root/osdep/path-unix.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-06-25 17:38:47 +0200
committerwm4 <wm4@nowhere>2020-06-25 17:56:16 +0200
commit269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0 (patch)
tree9509d158f7e5e5d60c18030fb61eb2649f88ca52 /osdep/path-unix.c
parentafe2b83183aa549ba45e9228a48a36f6d3cf4a6a (diff)
downloadmpv-269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0.tar.bz2
mpv-269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0.tar.xz
path: switch back to using non-XDG config dir by default
XDG is stupid, so change back to the standard behavior. Unfortunately, most users will now have the XDG one, so we will still need to load this. (This is exactly the same problem as when XDG support was introduced, just the other way around). This should not affect any normal users. Hopefully I tested this well enough; my intention is not to torment miserable XDG fans; they can keep using their config dir if they want it. This changes behavior in two cases: - new users (now creates ~/.mpv/ instead of ~/.config/mpv/) - users which have both directories The latter case will behave subtly or obviously different, not sure. Just fix your shit. Extend the manpage with all the messy details, as far as I could reverse engineer them from the code.
Diffstat (limited to 'osdep/path-unix.c')
-rw-r--r--osdep/path-unix.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/osdep/path-unix.c b/osdep/path-unix.c
index d9a49ab06d..4a79a1838e 100644
--- a/osdep/path-unix.c
+++ b/osdep/path-unix.c
@@ -33,17 +33,17 @@ static void path_init(void)
char *home = getenv("HOME");
char *xdg_dir = getenv("XDG_CONFIG_HOME");
+ if (home && home[0])
+ snprintf(mpv_home, sizeof(mpv_home), "%s/.mpv", home);
+
+ // Maintain compatibility with old XDG config dirs
if (xdg_dir && xdg_dir[0]) {
- snprintf(mpv_home, sizeof(mpv_home), "%s/mpv", xdg_dir);
+ snprintf(old_home, sizeof(old_home), "%s/mpv", xdg_dir);
} else if (home && home[0]) {
- snprintf(mpv_home, sizeof(mpv_home), "%s/.config/mpv", home);
+ snprintf(old_home, sizeof(old_home), "%s/.config/mpv", home);
}
- // Maintain compatibility with old ~/.mpv
- if (home && home[0])
- snprintf(old_home, sizeof(old_home), "%s/.mpv", home);
-
- // If the old ~/.mpv exists, and the XDG config dir doesn't, use the old
+ // If the compat. dir exists, and the proper dir doesn't, use the compat.
// config dir only.
if (mp_path_exists(old_home) && !mp_path_exists(mpv_home)) {
snprintf(mpv_home, sizeof(mpv_home), "%s", old_home);