summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-03-29 12:06:23 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-03-29 12:06:23 +0000
commit44ff671fe5584a9fb073c4b767825c58504aa083 (patch)
tree2c04b0778f9f3673b84f94d13447c11019fd0d6a /Src
parent3278ad8490ce04f5178e8873661a369f34d04531 (diff)
downloadzsh-44ff671fe5584a9fb073c4b767825c58504aa083.tar.gz
zsh-44ff671fe5584a9fb073c4b767825c58504aa083.tar.xz
zsh-44ff671fe5584a9fb073c4b767825c58504aa083.zip
Don't assume we can change the string for the HOST parameter when used in
a prompt
Diffstat (limited to 'Src')
-rw-r--r--Src/prompt.c5
1 files changed, 1 insertions, 4 deletions
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;