From e7feca18d526db89436de90fb78f3de911603d35 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 26 Nov 1999 01:12:26 +0000 Subject: zsh-workers/8783 --- Src/lex.c | 16 ++++++---------- 1 file 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(); -- cgit 1.4.1