mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-20 10:08:02 +02:00
zsh-workers:6121
This commit is contained in:
parent
d19043f157
commit
3e5977cdee
1 changed files with 38 additions and 4 deletions
|
@ -1515,12 +1515,46 @@ get_comp_string(void)
|
||||||
*/
|
*/
|
||||||
for (i = 0, p = s; *p; p++, i++) {
|
for (i = 0, p = s; *p; p++, i++) {
|
||||||
/* careful, ${... is not a brace expansion...
|
/* careful, ${... is not a brace expansion...
|
||||||
* in fact, if it's got a substitution in it's too
|
* we try to get braces after a parameter expansion right,
|
||||||
* hard for us anyway. sorry.
|
* but this may fail sometimes. sorry.
|
||||||
*/
|
*/
|
||||||
if (*p == String || *p == Qstring) {
|
if (*p == String || *p == Qstring) {
|
||||||
tt = NULL;
|
if (p[1] == Inbrace) {
|
||||||
break;
|
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) {
|
} else if (*p == Inbrace) {
|
||||||
if (tt) {
|
if (tt) {
|
||||||
/* too many inbraces */
|
/* too many inbraces */
|
||||||
|
|
Loading…
Reference in a new issue