From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26907 invoked by alias); 12 Sep 2015 23:09:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36522 Received: (qmail 27095 invoked from network); 12 Sep 2015 23:09:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=P1ZR62tIc1vjt2LYoqNm6ld4yDVcOL7gnaKgNHZ50pA=; b=GiLZSoQUv9awM/iy34fK3bzrzeSmrdZVE8S6jRRcMJbzqEO1/pKelbVNeCubh4SLfe b2DB6Oc0NwMSdWFNfuHYMp6ZyJkLZqDtLn38FPA55gBi59MQX3OGGeu0pxiHIFmn2+wc es/JAZLI2q3NEvk/sQjKNmuE056JyE8EjhNfXH52UkuSSYR7KY2xidp0+kGdTpH87bSd jZfApGGj9qc9ExAQpKKY7ttVfFk1Ptg6q1vtiEFYHKcHtlTeRHVMYP5s2i2aYrOAdOUX nvXmi2osgBb8d/qtFWcuFMzyB/rjoxTwIjdLfEuKpBGEQQEcLe8tixWx+YhVVOY75sJv HqVg== X-Gm-Message-State: ALoCoQkxvaOcDRFqjLAfAgrRdaWQCenr8Gzhw0pPU2Ia9nlM4HBUXBVhlJOwmOAPYc0kfrwsKH0d X-Received: by 10.202.108.147 with SMTP id h141mr4705913oic.86.1442099372592; Sat, 12 Sep 2015 16:09:32 -0700 (PDT) From: Bart Schaefer Message-Id: <150912160929.ZM26166@torch.brasslantern.com> Date: Sat, 12 Sep 2015 16:09:29 -0700 In-Reply-To: Comments: In reply to Bart Schaefer "Re: PATCH: read full multibyte string a bit more sooner" (Sep 12, 1:35pm) References: <9wl4rxcdnmx1pobphlhpr6r7.1442088207988@email.android.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: PATCH: read full multibyte string a bit more sooner MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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");