diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-07-13 17:06:19 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-07-13 17:06:19 +0000 |
commit | d13f6631d7e728dad2b3a0bc0521f56fc3f2425b (patch) | |
tree | dc4fac9ee9bdb28b717f9e3f7c1cdc24c981f03f /Src/params.c | |
parent | 0982f4ee6435d3b5ad6bcdf131405e90211dc5bf (diff) | |
download | zsh-d13f6631d7e728dad2b3a0bc0521f56fc3f2425b.tar.gz zsh-d13f6631d7e728dad2b3a0bc0521f56fc3f2425b.tar.xz zsh-d13f6631d7e728dad2b3a0bc0521f56fc3f2425b.zip |
12247: internal hostnam variable removed in favour of $HOST
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/params.c b/Src/params.c index 972922856..4f519d476 100644 --- a/Src/params.c +++ b/Src/params.c @@ -56,7 +56,6 @@ char **path, /* $path */ /**/ char *argzero, /* $0 */ *home, /* $HOME */ - *hostnam, /* $HOST */ *nullcmd, /* $NULLCMD */ *oldpwd, /* $OLDPWD */ *zoptarg, /* $OPTARG */ @@ -458,7 +457,7 @@ createparamtable(void) Param ip, pm; char **new_environ, **envp, **envp2, **sigptr, **t; char **old_environ = environ; - char buf[50], *str, *iname; + char buf[50], *str, *iname, *hostnam; int num_env, oae = opts[ALLEXPORT]; #ifdef HAVE_UNAME struct utsname unamebuf; @@ -494,7 +493,12 @@ createparamtable(void) setsparam("TMPPREFIX", ztrdup(DEFAULT_TMPPREFIX)); setsparam("TIMEFMT", ztrdup(DEFAULT_TIMEFMT)); setsparam("WATCHFMT", ztrdup(default_watchfmt)); + + hostnam = (char *)zalloc(256); + gethostname(hostnam, 256); setsparam("HOST", ztrdup(hostnam)); + zfree(hostnam, 256); + setsparam("LOGNAME", ztrdup((str = getlogin()) && *str ? str : cached_username)); /* Copy the environment variables we are inheriting to dynamic * |