Bash-4.3 distribution sources and documentation

This commit is contained in:
Chet Ramey 2014-02-26 09:36:43 -05:00
commit ac50fbac37
497 changed files with 129395 additions and 87598 deletions

View file

@ -55,15 +55,26 @@ get_env_value (varname)
return ((char *)getenv (varname));
}
/* If we're not using $HOME, assume that the passwd file information won't
change while this shell instance is running. */
char *
get_home_dir ()
{
char *home_dir;
static char *home_dir = (char *)NULL;
struct passwd *entry;
home_dir = (char *)NULL;
if (home_dir)
return (home_dir);
#if defined (HAVE_GETPWUID)
entry = getpwuid (getuid ());
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);
}