summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--options/path.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/options/path.c b/options/path.c
index cd14e66bb7..5248a1d75b 100644
--- a/options/path.c
+++ b/options/path.c
@@ -173,7 +173,10 @@ char *mp_get_user_path(void *talloc_ctx, struct mpv_global *global,
talloc_free(tmp);
}
} else if (bstr_equals0(prefix, "")) {
- res = mp_path_join_bstr(talloc_ctx, bstr0(getenv("HOME")), rest);
+ char *home = getenv("HOME");
+ if (!home)
+ home = getenv("USERPROFILE");
+ res = mp_path_join_bstr(talloc_ctx, bstr0(home), rest);
} else if (bstr_eatstart0(&prefix, "~")) {
void *tmp = talloc_new(NULL);
char type[80];