Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh/complist colours improperly handle multibyte characters



On Oct 25, 11:44am, Peter Stephenson wrote:
}
} To fix this safely, we need first to metafy the input string,
} 
} * E2 83 B4 82 *
} 
} then tokenise it with the change I previously posted to skip Meta,

This seems to have done it.  I tried the metafy before tokenize route,
but without the change to zshtokenize that wasn't sufficient.

Do we also need this here?  And isn't it slightly better to pass -1
to metafy() rather than call strlen()?

diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index d4672a1..2edaf6e 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -347,9 +347,10 @@ getcoldef(char *s)
 	    char sav = p[1];
 
 	    p[1] = '\0';
+	    s = metafy(s, -1, META_USEHEAP);
 	    tokenize(s);
 	    gprog = patcompile(s, 0, NULL);
-	    p[1]  =sav;
+	    p[1] = sav;
 
 	    s = p + 1;
 	}
@@ -415,7 +416,7 @@ getcoldef(char *s)
 		break;
 	    *s++ = '\0';
 	}
-	p = metafy(p, strlen(p), META_USEHEAP);
+	p = metafy(p, -1, META_USEHEAP);
 	tokenize(p);
 	if ((prog = patcompile(p, 0, NULL))) {
 	    Patcol pc, po;



Messages sorted by: Reverse Date, Date, Thread, Author