summaryrefslogtreecommitdiff
path: root/Src/prompt.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-07-13 17:06:19 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-07-13 17:06:19 +0000
commitd13f6631d7e728dad2b3a0bc0521f56fc3f2425b (patch)
treedc4fac9ee9bdb28b717f9e3f7c1cdc24c981f03f /Src/prompt.c
parent0982f4ee6435d3b5ad6bcdf131405e90211dc5bf (diff)
downloadzsh-d13f6631d7e728dad2b3a0bc0521f56fc3f2425b.tar.gz
zsh-d13f6631d7e728dad2b3a0bc0521f56fc3f2425b.zip
12247: internal hostnam variable removed in favour of $HOST
Diffstat (limited to 'Src/prompt.c')
-rw-r--r--Src/prompt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Src/prompt.c b/Src/prompt.c
index 7bd4ed0f1..cca6da21f 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -201,7 +201,7 @@ promptexpand(char *s, int ns, char *rs, char *Rs)
static int
putpromptchar(int doprint, int endchar)
{
- char *ss, *tmbuf = NULL;
+ char *ss, *tmbuf = NULL, *hostnam;
int t0, arg, test, sep;
struct tm *tm;
time_t timet;
@@ -372,11 +372,14 @@ putpromptchar(int doprint, int endchar)
bp += strlen(bp);
break;
case 'M':
- stradd(hostnam);
+ if ((hostnam = getsparam("HOST")))
+ stradd(hostnam);
break;
case 'm':
if (!arg)
arg++;
+ if (!(hostnam = getsparam("HOST")))
+ break;
if (arg < 0) {
for (ss = hostnam + strlen(hostnam); ss > hostnam; ss--)
if (ss[-1] == '.' && !++arg)