mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-30 19:20:53 +02:00
zsh-workers/8783
This commit is contained in:
parent
121c60b9d6
commit
e7feca18d5
1 changed files with 6 additions and 10 deletions
16
Src/lex.c
16
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();
|
||||
|
|
Loading…
Reference in a new issue