Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bugs on SourceForge



> We should at least address 219457 and 219459 before 4.0.1, not because I
> submitted them, but because they're shell-crashers.

This should fix any lurking problems with %m in a prompt crashing the
shell.  We don't assume we can write to the return value of getsparam() any
more, which probably wasn't a good assumption at the best of times.  This
is general enough that I haven't looked further down, but I would assume
that we were getting back a "", which gcc would have put in the text
segment, but behaviour with other compilers would differ.  Hence the
variable experiences.

Index: Src/prompt.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v
retrieving revision 1.4
diff -u -r1.4 prompt.c
--- Src/prompt.c	2001/01/16 13:44:20	1.4
+++ Src/prompt.c	2001/03/29 11:18:23
@@ -392,10 +392,7 @@
 		    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;

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author