about summary refs log tree commit diff
path: root/Src/Zle/compcore.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-07-10 13:08:22 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-07-10 13:08:22 +0000
commit4a67f2479892fda348546404216270aaaff523ea (patch)
tree3157f967e4324cdf147aa656c021e55e96f29731 /Src/Zle/compcore.c
parent272256f5d6f4748aed680256589a67713e517383 (diff)
downloadzsh-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/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 008f49185..38b1934e2 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -1081,7 +1081,7 @@ check_param(char *s, int set, int test)
     }
     if ((*p == String || *p == Qstring) && p[1] != Inpar && p[1] != Inbrack) {
 	/* This is really a parameter expression (not $(...) or $[...]). */
-	char *b = p + 1, *e = b;
+	char *b = p + 1, *e = b, *ie;
 	int n = 0, br = 1, nest = 0;
 
 	if (*b == Inbrace) {
@@ -1124,10 +1124,16 @@ check_param(char *s, int set, int test)
 	else if (idigit(*e))
 	    while (idigit(*e))
 		e++;
-	else if (iident(*e))
-	    while (iident(*e) ||
-		   (comppatmatch && *comppatmatch && (*e == Star || *e == Quest)))
-		e++;
+	else if ((ie = itype_end(e, IIDENT, 0)) != e) {
+	    do {
+		e = ie;
+		if (comppatmatch && *comppatmatch &&
+		    (*e == Star || *e == Quest))
+		    ie = e + 1;
+		else
+		    ie = itype_end(e, IIDENT, 0);
+	    } while (ie != e);
+	}
 
 	/* Now make sure that the cursor is inside the name. */
 	if (offs <= e - s && offs >= b - s && n <= 0) {