diff --git a/src/rcfile.c b/src/rcfile.c index b9e2f091b..79c11d003 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -1725,7 +1725,7 @@ void do_rcfiles(void) parse_one_nanorc(); if (custom_nanorc == NULL) { - const char *xdgconfdir = getenv("XDG_CONFIG_HOME"); + const char *xdgconfdir = getenv("APPDATA"); get_homedir(); diff --git a/src/utils.c b/src/utils.c index 842d869d4..ed25b419f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -36,9 +36,7 @@ void get_homedir(void) if (homedir == NULL) { const char *homenv = getenv("USERPROFILE"); - /* When HOME isn't set, or when we're root, get the home directory - * from the password file instead. */ - if (homenv == NULL || IsUserAnAdmin()) + if (homenv == NULL) homenv = getenv("ALLUSERSPROFILE"); /* Only set homedir if some home directory could be determined,