about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-09-02 15:26:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-09-02 15:26:44 +0000
commit6d4d1261a5c813033f01e90c708c0dcfbc7e1b6e (patch)
treefe7d9829f4e52c617e754b3611706b5cfc46cd90
parent5b80d50ad3b88b74ff84ae760d80d7a965ea5670 (diff)
downloadzsh-6d4d1261a5c813033f01e90c708c0dcfbc7e1b6e.tar.gz
zsh-6d4d1261a5c813033f01e90c708c0dcfbc7e1b6e.tar.xz
zsh-6d4d1261a5c813033f01e90c708c0dcfbc7e1b6e.zip
27240: fix fix for lexing in test builtin
-rw-r--r--ChangeLog7
-rw-r--r--Src/builtin.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f6d98856..8ecc79fe9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-02  Peter Stephenson  <pws@csr.com>
+
+	* 27240: Src/builtin.c: 27079 caused later use of tokstr and tok
+	to be invalid.
+
 2009-08-28  Peter Stephenson  <pws@csr.com>
 
 	* 27233: Completion/Base/Utility/_values,
@@ -12106,5 +12111,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4765 $
+* $Revision: 1.4766 $
 *****************************************************
diff --git a/Src/builtin.c b/Src/builtin.c
index 2d5489c21..f032230b6 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5818,17 +5818,19 @@ bin_test(char *name, char **argv, UNUSED(Options ops), int func)
     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");