zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zsh/complist colours improperly handle multibyte characters
Date: Tue, 25 Oct 2016 08:59:20 -0700	[thread overview]
Message-ID: <161025085920.ZM7192@torch.brasslantern.com> (raw)
In-Reply-To: <20161025114425.64574aff@pwslap01u.europe.root.pri>

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;


  reply	other threads:[~2016-10-25 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161021011017eucas1p1d1fceae920242e69b4426bc41cb3c064@eucas1p1.samsung.com>
2016-10-21  1:09 ` Danielle McLean
2016-10-21  4:07   ` Bart Schaefer
2016-10-23 17:30     ` Peter Stephenson
2016-10-23 18:23       ` Bart Schaefer
     [not found]     ` <20161023184641.4549e10a@ntlworld.com>
     [not found]       ` <161023105652.ZM3309@torch.brasslantern.com>
2016-10-23 18:59         ` Peter Stephenson
2016-10-23 19:34           ` Bart Schaefer
2016-10-25 10:44             ` Peter Stephenson
2016-10-25 15:59               ` Bart Schaefer [this message]
2016-10-25 16:05                 ` Peter Stephenson
2016-10-21  8:33   ` Peter Stephenson
2016-10-21 15:48     ` 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=161025085920.ZM7192@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).