about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-26 01:12:26 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-26 01:12:26 +0000
commite7feca18d526db89436de90fb78f3de911603d35 (patch)
tree0abb44f1beb67e089e6dcac4e297cca0f7297fce
parent121c60b9d6bb813623330b8f2cc69bb127552586 (diff)
downloadzsh-e7feca18d526db89436de90fb78f3de911603d35.tar.gz
zsh-e7feca18d526db89436de90fb78f3de911603d35.tar.xz
zsh-e7feca18d526db89436de90fb78f3de911603d35.zip
zsh-workers/8783
-rw-r--r--Src/lex.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Src/lex.c b/Src/lex.c
index db00aff40..2285208fc 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -805,7 +805,7 @@ gettokstr(int c, int sub)
 {
     int bct = 0, pct = 0, brct = 0, fdpar = 0;
     int intpos = 1, in_brace_param = 0;
-    int peek, inquote;
+    int peek, inquote, unmatched = 0;
 #ifdef DEBUG
     int ocmdsp = cmdsp;
 #endif
@@ -1119,9 +1119,7 @@ gettokstr(int c, int sub)
 		}
 		ALLOWHIST
 		if (c != '\'') {
-		    lineno -= (c == '\n');
-		    zerr("unmatched \'", NULL, 0);
-		    lineno += (c == '\n');
+		    unmatched = '\'';
 		    peek = LEXERR;
 		    cmdpop();
 		    goto brk;
@@ -1143,9 +1141,7 @@ gettokstr(int c, int sub)
 	    c = dquote_parse('"', sub);
 	    cmdpop();
 	    if (c) {
-		lineno -= (c == '\n');
-		zerr("unmatched \"", NULL, 0);
-		lineno += (c == '\n');
+		unmatched = '"';
 		peek = LEXERR;
 		goto brk;
 	    }
@@ -1182,9 +1178,7 @@ gettokstr(int c, int sub)
 		ALLOWHIST
 	    cmdpop();
 	    if (c != '`') {
-		lineno -= (c == '\n');
-		zerr("unmatched `", NULL, 0);
-		lineno += (c == '\n');
+		unmatched = '`';
 		peek = LEXERR;
 		goto brk;
 	    }
@@ -1201,6 +1195,8 @@ gettokstr(int c, int sub)
     }
   brk:
     hungetc(c);
+    if (unmatched)
+	zerr("unmatched %c", NULL, unmatched);
     if (in_brace_param) {
 	while(bct-- >= in_brace_param)
 	    cmdpop();