1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-15 20:38:10 +02:00

zsh-workers:6121

This commit is contained in:
Tanaka Akira 1999-04-27 17:38:32 +00:00
parent d19043f157
commit 3e5977cdee

View file

@ -1515,12 +1515,46 @@ get_comp_string(void)
*/
for (i = 0, p = s; *p; p++, i++) {
/* careful, ${... is not a brace expansion...
* in fact, if it's got a substitution in it's too
* hard for us anyway. sorry.
* we try to get braces after a parameter expansion right,
* but this may fail sometimes. sorry.
*/
if (*p == String || *p == Qstring) {
tt = NULL;
break;
if (p[1] == Inbrace) {
char *tp = p + 1;
if (skipparens(Inbrace, Outbrace, &tp)) {
tt = NULL;
break;
}
i += tp - p;
p = tp;
} else {
char *tp = p + 1;
if (*tp == Quest || *tp == Star || *tp == String ||
*tp == Qstring || *tp == '?' || *tp == '*' ||
*tp == '$' || *tp == '-' || *tp == '!' ||
*tp == '@')
p++, i++;
else {
if (idigit(*tp))
while (idigit(*tp))
tp++;
else if (iident(*tp))
while (iident(*tp))
tp++;
else {
tt = NULL;
break;
}
if (*tp == Inbrace) {
tt = NULL;
break;
}
tp--;
i += tp - p;
p = tp;
}
}
} else if (*p == Inbrace) {
if (tt) {
/* too many inbraces */