Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Couple of bugs in 3.1.9-dev-3
- X-seq: zsh-workers 12337
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: Couple of bugs in 3.1.9-dev-3
- Date: Fri, 21 Jul 2000 09:49:09 +0200 (MET DST)
- In-reply-to: mason@xxxxxxxxxxxxxxx's message of 21 Jul 2000 01:07:07 GMT
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Geoff Wing wrote:
> coral% zsh-3.1.9-dev-3 -f
> % time | time
> unknown word code in gettext2()
> unknown word code in gettext2()
> unknown word code in gettext2()
> unknown word code in gettext2()
> unknown word code in gettext2()
> % time | echo
> zsh: 14281 segmentation fault (core dumped) zsh -f
> coral% zsh-3.1.9-dev-3 -f
> % time | time; echo
> zsh: 14281 segmentation fault (core dumped) zsh -f
Uh, oh. Wrong parsing of `time' withoout a command to measure.
Bye
Sven
Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.11
diff -u -r1.11 parse.c
--- Src/parse.c 2000/07/19 20:40:18 1.11
+++ Src/parse.c 2000/07/21 07:48:40
@@ -1389,9 +1389,13 @@
p = ecadd(0);
ecadd(0);
- f = par_sublist2(&c);
- ecbuf[p] = WCB_TIMED((p + 1 == ecused) ? WC_TIMED_EMPTY : WC_TIMED_PIPE);
- set_sublist_code(p + 1, WC_SUBLIST_END, f, ecused - 2 - p, c);
+ if ((f = par_sublist2(&c)) < 0) {
+ ecused--;
+ ecbuf[p] = WCB_TIMED(WC_TIMED_EMPTY);
+ } else {
+ ecbuf[p] = WCB_TIMED(WC_TIMED_PIPE);
+ set_sublist_code(p + 1, WC_SUBLIST_END, f, ecused - 2 - p, c);
+ }
}
/*
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author