about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-03-29 19:47:01 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-03-29 19:47:01 +0100
commitf1c702f2a4159409b27b9576999614a69a51987d (patch)
tree947a2fef650080a52feb33e7ae359e0cdae1ed80 /Src/lex.c
parentb4aa9cdc7641c6c923c1bda1c73111d80be79ba1 (diff)
downloadzsh-f1c702f2a4159409b27b9576999614a69a51987d.tar.gz
zsh-f1c702f2a4159409b27b9576999614a69a51987d.tar.xz
zsh-f1c702f2a4159409b27b9576999614a69a51987d.zip
34817: Catch some errors earlier when reading history.
Mostly for the case of an interrupt.

Don't try to process words when we know something's gone wrong.

Also abort history reading earlier on an interrupt.
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 5fed2be49..184a54b0b 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1345,6 +1345,8 @@ gettokstr(int c, int sub)
 	    break;
     }
   brk:
+    if (errflag)
+	return LEXERR;
     hungetc(c);
     if (unmatched)
 	zerr("unmatched %c", unmatched);