Commit e06472a2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Keeping homedir NULL when no home directory could be determined,

so that nano will show a message about it.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5259 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 7 additions and 1 deletion
+7 -1
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* src/search.c (do_research): If nothing was searched for yet during * src/search.c (do_research): If nothing was searched for yet during
this run of nano, take the most recent item from the search history. this run of nano, take the most recent item from the search history.
This makes M-W work also right after startup, like <n> in vim/less. This makes M-W work also right after startup, like <n> in vim/less.
* src/utils.c (get_homedir): Keep homedir NULL when no home directory
could be determined, so that nano will show a message about it.
2015-06-18 Benno Schulenberg <bensberg@justemail.net> 2015-06-18 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c: Allow a tiny nano's ~/.nanorc to enable search and * src/rcfile.c: Allow a tiny nano's ~/.nanorc to enable search and
......
...@@ -43,6 +43,10 @@ void get_homedir(void) ...@@ -43,6 +43,10 @@ void get_homedir(void)
if (userage != NULL) if (userage != NULL)
homenv = userage->pw_dir; homenv = userage->pw_dir;
} }
/* Only set homedir if some home directory could be determined,
* otherwise keep homedir NULL. */
if (homenv != NULL && strcmp(homenv, "") != 0)
homedir = mallocstrcpy(NULL, homenv); homedir = mallocstrcpy(NULL, homenv);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment