From d13f6631d7e728dad2b3a0bc0521f56fc3f2425b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 13 Jul 2000 17:06:19 +0000 Subject: 12247: internal hostnam variable removed in favour of $HOST --- Src/prompt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Src/prompt.c') 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) -- cgit v1.2.3