summaryrefslogtreecommitdiffstats
path: root/osdep/path-unix.c
diff options
context:
space:
mode:
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 4a79a1838e..d9a49ab06d 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(old_home, sizeof(old_home), "%s/mpv", xdg_dir);
+ snprintf(mpv_home, sizeof(mpv_home), "%s/mpv", xdg_dir);
} else if (home && home[0]) {
- snprintf(old_home, sizeof(old_home), "%s/.config/mpv", home);
+ snprintf(mpv_home, sizeof(mpv_home), "%s/.config/mpv", home);
}
- // If the compat. dir exists, and the proper dir doesn't, use the compat.
+ // 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
// config dir only.
if (mp_path_exists(old_home) && !mp_path_exists(mpv_home)) {
snprintf(mpv_home, sizeof(mpv_home), "%s", old_home);