commit bash-20130301 snapshot

This commit is contained in:
Chet Ramey
2013-03-26 20:51:22 -04:00
parent 8eb22ee966
commit c7e43312f9
220 changed files with 45368 additions and 801 deletions
+10 -2
View File
@@ -155,9 +155,12 @@ sh_get_env_value (varname)
char *
sh_get_home_dir ()
{
char *home_dir;
static char *home_dir = (char *)NULL;
struct passwd *entry;
if (home_dir)
return (home_dir);
home_dir = (char *)NULL;
#if defined (HAVE_GETPWUID)
# if defined (__TANDEM)
@@ -166,8 +169,13 @@ sh_get_home_dir ()
entry = getpwuid (getuid ());
# endif
if (entry)
home_dir = entry->pw_dir;
home_dir = savestring (entry->pw_dir);
#endif
#if defined (HAVE_GETPWENT)
endpwent (); /* some systems need this */
#endif
return (home_dir);
}