Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: read full multibyte string a bit more sooner
- X-seq: zsh-workers 36522
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: read full multibyte string a bit more sooner
- Date: Sat, 12 Sep 2015 16:09:29 -0700
- In-reply-to: <CAH+w=7ZN++uTZ+5W=upzcaU1Urx26tmXZy5gyHKxg+resNhDiw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <9wl4rxcdnmx1pobphlhpr6r7.1442088207988@email.android.com> <CAH+w=7ZN++uTZ+5W=upzcaU1Urx26tmXZy5gyHKxg+resNhDiw@mail.gmail.com>
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