diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2006-07-10 13:08:22 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-07-10 13:08:22 +0000 |
commit | 4a67f2479892fda348546404216270aaaff523ea (patch) | |
tree | 3157f967e4324cdf147aa656c021e55e96f29731 /Src/params.c | |
parent | 272256f5d6f4748aed680256589a67713e517383 (diff) | |
download | zsh-4a67f2479892fda348546404216270aaaff523ea.tar.gz zsh-4a67f2479892fda348546404216270aaaff523ea.tar.xz zsh-4a67f2479892fda348546404216270aaaff523ea.zip |
22544: Improve use of ztype tests for multibyte characters. Add
POSIX_IDENTIFIERS option to control allowability of multibyte alphanumeric characters in parameter and module names.
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Src/params.c b/Src/params.c index f589a740e..17ce2c54d 100644 --- a/Src/params.c +++ b/Src/params.c @@ -899,9 +899,7 @@ isident(char *s) break; } else { /* Find the first character in `s' not in the iident type table */ - for (ss = s; *ss; ss++) - if (!iident(*ss)) - break; + ss = itype_end(s, IIDENT, 0); } /* If the next character is not [, then it is * @@ -1653,7 +1651,7 @@ getvalue(Value v, char **pptr, int bracks) mod_export Value fetchvalue(Value v, char **pptr, int bracks, int flags) { - char *s, *t; + char *s, *t, *ie; char sav, c; int ppar = 0; @@ -1665,9 +1663,8 @@ fetchvalue(Value v, char **pptr, int bracks, int flags) else ppar = *s++ - '0'; } - else if (iident(c)) - while (iident(*s)) - s++; + else if ((ie = itype_end(s, IIDENT, 0)) != s) + s = ie; else if (c == Quest) *s++ = '?'; else if (c == Pound) @@ -1732,7 +1729,7 @@ fetchvalue(Value v, char **pptr, int bracks, int flags) return v; } } else if (!(flags & SCANPM_ASSIGNING) && v->isarr && - iident(*t) && isset(KSHARRAYS)) + itype_end(t, IIDENT, 1) != t && isset(KSHARRAYS)) v->end = 1, v->isarr = 0; } if (!bracks && *s) |