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

Re: Zsh 3.1.6 still hangs on for loops utilizing lots of stdout



[ No idea about the main problem yet, but... ]

Alexandre Duret-Lutz wrote:

> ...
> /goinfre/swiss-2 % for i in *.wav                                    Err 139 #6
> do
>   8hz-mp3 $i $i:r.mp3
> done | od
> 
> [...lot's of output...]
> 
> zsh: exit 141            for i in *.wav; do; 8hz-mp3 $i $i:r.mp3; done | od | 
> zsh: segmentation fault  od                                               
> 
> How fun! now, that's od which is segfaulting. BTW where does this last pipe
> (after `od' on the exit report line) come from?.

At least this can be fixed. Thinko in execpline2().

Bye
 Sven

diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Fri Feb  4 16:07:26 2000
+++ Src/exec.c	Mon Feb  7 11:11:29 2000
@@ -1112,7 +1112,10 @@
 
     if (pline_level == 1) {
 	if ((how & Z_ASYNC) || (!sfcontext && !sourcelevel))
-	    strcpy(list_pipe_text, getjobtext(state->prog, state->pc - 1));
+	    strcpy(list_pipe_text,
+		   getjobtext(state->prog,
+			      state->pc + (WC_PIPE_TYPE(pcode) == WC_PIPE_END ?
+					   0 : 1)));
 	else
 	    list_pipe_text[0] = '\0';
     }
@@ -1142,7 +1145,7 @@
 	    } else if (pid) {
 		char dummy, *text;
 
-		text = getjobtext(state->prog, state->pc - 2);
+		text = getjobtext(state->prog, state->pc);
 		addproc(pid, text);
 		close(synch[1]);
 		read(synch[0], &dummy, 1);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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