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

Re: Command line bug since zsh 3.1.7...



On Wed, 29 Sep 2004, Sebastian Rasmussen wrote:

> hal9000% zsh -c 'echo bar |'
> zsh: segmentation fault  zsh -c 'echo bar |'

Seems to be this easy (and it should have been obvious that it's wrong
to ignore the result of the recursive parse):


Index: parse.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/parse.c,v
retrieving revision 1.20
diff -c -r1.20 parse.c
--- parse.c	14 Aug 2004 05:01:23 -0000	1.20
+++ parse.c	30 Sep 2004 03:50:06 -0000
@@ -729,9 +729,9 @@
 	ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0));
 	ecispace(p + 1, 1);
 	ecbuf[p + 1] = ecused - 1 - p;
-	par_pline(complex);
+	p = par_pline(complex);
 	cmdpop();
-	return 1;
+	return p;
     } else if (tok == BARAMP) {
 	int r;
 
@@ -750,9 +750,9 @@
 	ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0));
 	ecispace(p + 1, 1);
 	ecbuf[p + 1] = ecused - 1 - p;
-	par_pline(complex);
+	p = par_pline(complex);
 	cmdpop();
-	return 1;
+	return p;
     } else {
 	ecbuf[p] = WCB_PIPE(WC_PIPE_END, (line >= 0 ? line + 1 : 0));
 	return 1;



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