1
0
Fork 0
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:
Tanaka Akira 1999-11-26 01:12:26 +00:00
parent 121c60b9d6
commit e7feca18d5

View file

@ -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();