From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: read full multibyte string a bit more sooner
Date: Sat, 12 Sep 2015 16:09:29 -0700 [thread overview]
Message-ID: <150912160929.ZM26166@torch.brasslantern.com> (raw)
In-Reply-To: <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");
next prev parent reply other threads:[~2015-09-12 23:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-12 20:07 Peter Stephenson
2015-09-12 20:35 ` Bart Schaefer
2015-09-12 23:09 ` Bart Schaefer [this message]
2015-09-19 19:25 ` Peter Stephenson
2015-09-19 20:49 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
2015-09-12 19:41 Peter Stephenson
2015-09-12 19:49 ` Bart Schaefer
2015-09-11 20:29 Peter Stephenson
2015-09-11 22:42 ` Bart Schaefer
2015-09-12 9:57 ` Peter Stephenson
2015-09-12 16:46 ` Bart Schaefer
2015-09-12 17:56 ` Peter Stephenson
2015-09-12 18:02 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=150912160929.ZM26166@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).