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

PATCH: Re: Segmentation fault 3.1.7-pre-3/4



Bernd Eggink wrote:

> This gives a seg fault if executed in a script:
> 
>     read -q "REPLY?hm: "
> 
> Happens with pre-3 and pre-4, not with pre-1.

Oh, look Bart, there's the reason to not always use shout (11036).

The patch tries to make sure we're always on the save side. I
hope. It's different from the pre-11036 state.

But with zle not loaded, the

	zsh -c "read -q '?Can you see this? '" < /dev/null >& /dev/null

from 11036 doesn't show the prompt (but at least it doesn't segv
anymore). Is it right or wrong? Do we have to work around it?

Bye
 Sven

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.18
diff -u -r1.18 builtin.c
--- Src/builtin.c	2000/05/19 15:10:54	1.18
+++ Src/builtin.c	2000/05/23 08:30:31
@@ -3440,8 +3440,8 @@
 	     *readpmpt && *readpmpt != '?'; readpmpt++);
 	if (*readpmpt++) {
 	    if (keys || isatty(0)) {
-		zputs(readpmpt, shout);
-		fflush(shout);
+		zputs(readpmpt, (shout ? shout : stderr));
+		fflush(shout ? shout : stderr);
 	    }
 	    readpmpt[-1] = '\0';
 	}

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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