diff options
Diffstat (limited to 'winsup/utils/mkpasswd.c')
-rw-r--r-- | winsup/utils/mkpasswd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c index 5373719c5..6ca4e5db3 100644 --- a/winsup/utils/mkpasswd.c +++ b/winsup/utils/mkpasswd.c @@ -172,13 +172,9 @@ current_user (const char *sep, const char *passed_home_path, DWORD id_offset, *GetSidSubAuthorityCount(curr_pgrp.psid) - 1); if (passed_home_path[0] == '\0') { - char *envhome = getenv ("HOME"); + char *envhome = getenv ("HOME"); /* POSIX! */ - /* If $HOME exists and is non-empty, just copy it over to homedir_psx. - Otherwise, generate a new path of the form "/home/$USER". */ - if (envhome && envhome[0] != '\0') - strncat (homedir_psx, envhome, sizeof (homedir_psx) - 1); - else + if (!envhome || envhome[0] == '\0') { wcstombs (stpncpy (homedir_psx, "/home/", sizeof (homedir_psx)), user, sizeof (homedir_psx) - 6); |