summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/prompt.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 85edc7ccd..b5ad41ded 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2001-03-29  Peter Stephenson  <pws@csr.com>
 
-	* 13837: Src/builtin.c: disallows changing of parameter type
+	* 13838: Src/prompt.c: don't assume we can change the string
+	returned by getsparam("HOST").
+
+	* 13837: Src/builtin.c: disallow changing of parameter type
 	for autoloadable parameter (bug 219459 on Sourceforge).
 
 2001-03-29  Sven Wischnowsky  <wischnow@zsh.org>
diff --git a/Src/prompt.c b/Src/prompt.c
index b90bfff2a..84f88b2d3 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -392,10 +392,7 @@ putpromptchar(int doprint, int endchar)
 		    for (ss = hostnam; *ss; ss++)
 			if (*ss == '.' && !--arg)
 			    break;
-		    t0 = *ss;
-		    *ss = '\0';
-		    stradd(hostnam);
-		    *ss = t0;
+		    stradd(*ss ? dupstrpfx(hostnam, ss - hostnam) : hostnam);
 		}
 		unqueue_signals();
 		break;