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

Re: PATCH: read full multibyte string a bit more sooner



On Sep 12,  1:35pm, Bart Schaefer wrote:
}
} So it's specific to reading bytes out of (or putting them into) the
} kungetbuf.

This probably goes back all the way to the initial implementation of
multibyte.  If the input to "zle -U" is the wide character represented
by the two bytes 0xc4 0x84, then after it passes through "zle -U" it
comes back as the three bytes 0xc4 0x83 0xa4, which are then handled
literally by getbyte() -- so this is a metafication problem.

The string is already metafied when it comes to bin_zle_unget() in
the args array.  I suppose it should be unmetafied there, only to be
metafied again later?  Indeed, that seems to work.

(Weird that unmeta() calls its argument "file_name".  Historical, I
suppose.)


diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index 7fd3a59..da3a6d4 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -466,7 +466,7 @@ bin_zle_mesg(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 static int
 bin_zle_unget(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
-    char *b = *args, *p = b + strlen(b);
+    char *b = unmeta(*args), *p = b + strlen(b);
 
     if (!zleactive) {
 	zwarnnam(name, "can only be called from widget function");



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