From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4051 invoked by alias); 25 Oct 2016 18:59:05 -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: 39725 Received: (qmail 3482 invoked from network); 25 Oct 2016 18:59:05 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f169.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.169):SA:0(0.0/5.0):. Processed in 0.566401 secs); 25 Oct 2016 18:59:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=BK02Cx7pVole6T75PKTMy0fkNso34Y0uE8DAH97gcuI=; b=DbCdyPummxYS94qtOtEIS+mEJQWwz9+ZUEyvtmDnJRxYh+TjM73xeGSUFfUpzb9/gk YQQyVjdpOlRleMuMuWzlACulHaOMi0/iDug/kqIuc976mIKmr7zh3UOYknmA9ds6pDVU tr6R7yxBLk3vkbHpwvHn9CPHzIp3F6YI8aF+80EUKRT4jPI3CYq8mLllfsp4vxREkijZ FA+JjTyVc/SXyGmRK1qomMWBAuXprxit0b7z4Yq5rukg7Fw4Ck1yxY6mQjFXJR/LzYlG +xDAF2yvGUnuvxdEjv7wGs8vVEI10mfBI9DKcKNb98naoT5msJOYiO3DOTFyac/1NnMf K84w== 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; bh=BK02Cx7pVole6T75PKTMy0fkNso34Y0uE8DAH97gcuI=; b=LwQKuMLKoJmMc1BGhTgcrzlQ5zwvqOnw1OoykOML6c/T/V4owSuS5WiEP6i30+u2GO qakZqmUtg7Cy8YUGt1RX3qDuDlRDuJReH0p9/I91PpQTkvfDDgT3oi25IEQpvI6XXYdJ okbDVWt7fzWpRqX+FS68Ef4+adW4MvBL5+tfgFthjixRFZq9Ivtcbg2xB0E87lsHRM6A Kmgi0ZsIIywv4YOBBfrclC74KgV/hOPMm+nYhpbBRCCZeQQvkoh8iTQHx/NGfKyL4I6q N/JO6q/l5vaCChnyWNCb4j7U1RhylUasvDKJNTjchoCNlPIT5ZzHTvuZCQ9PswO62xRI rHTQ== X-Gm-Message-State: ABUngve50ZvJGG363f/swj+9FbLoi0lqAeCkUT6Rzac/nxPInNmwurTA2EhNH3ttvkYm7g== X-Received: by 10.159.36.51 with SMTP id 48mr9501135uaq.124.1477411150737; Tue, 25 Oct 2016 08:59:10 -0700 (PDT) From: Bart Schaefer Message-Id: <161025085920.ZM7192@torch.brasslantern.com> Date: Tue, 25 Oct 2016 08:59:20 -0700 In-Reply-To: <20161025114425.64574aff@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: zsh/complist colours improperly handle multibyte characters" (Oct 25, 11:44am) References: <161020210735.ZM6446@torch.brasslantern.com> <20161023184641.4549e10a@ntlworld.com> <161023105652.ZM3309@torch.brasslantern.com> <20161023195908.40edc8cf@ntlworld.com> <161023123416.ZM3982@torch.brasslantern.com> <20161025114425.64574aff@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: zsh/complist colours improperly handle multibyte characters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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;