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

Re: Bug#537283: homing in



Clint Adams wrote:
> On Wed, Sep 02, 2009 at 09:09:12AM +0200, martin f krafft wrote:
> > % precmd_test() { set -x; test -d . && echo . is a directory; set +x; }
> > % precmd_functions=(precmd_test)
> > +precmd_test:0> test -d .
> > +precmd_test:0> echo . is a directory
> > . is a directory
> > +precmd_test:0> set +x
> > % [PRESS CTRL-C]
> > +precmd_test:0> test -d .
> > precmd_test:test: argument expected
> > +precmd_test:0> set +x

Incomplete previous patch (27079).

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.234
diff -u -r1.234 builtin.c
--- Src/builtin.c	24 Jul 2009 18:35:53 -0000	1.234
+++ Src/builtin.c	2 Sep 2009 15:18:03 -0000
@@ -5818,17 +5818,19 @@
     testlex();
     prog = parse_cond();
     condlex = zshlex;
-    lexrestore();
 
     if (errflag) {
 	errflag = 0;
+	lexrestore();
 	return 1;
     }
 
     if (!prog || tok == LEXERR) {
 	zwarnnam(name, tokstr ? "parse error" : "argument expected");
+	lexrestore();
 	return 1;
     }
+    lexrestore();
 
     if (*curtestarg) {
 	zwarnnam(name, "too many arguments");

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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