Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix admin profile config and support APPDATA. #42

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rcfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 1 addition & 3 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down