Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh 4.3.10 history-incremental-search-backward freezes in UTF-8
- X-seq: zsh-workers 27804
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zsh 4.3.10 history-incremental-search-backward freezes in UTF-8
- Date: Thu, 18 Mar 2010 15:44:24 +0000
- In-reply-to: <20100318152056.GO1761@xxxxxxxxxxxxxxxxxxx>
- 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
- Organization: CSR
- References: <20100318105005.GM1761@xxxxxxxxxxxxxxxxxxx> <201003181430.o2IEUK3T011374@xxxxxxxxxxxxxx> <20100318152056.GO1761@xxxxxxxxxxxxxxxxxxx>
On Thu, 18 Mar 2010 16:20:56 +0100
Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> On 2010-03-18 14:30:20 +0000, Peter Stephenson wrote:
> > I can't think of anything that's changed that would have fixed this (but
> > it's been a long time now and we're due for another releases). I won't
> > be doing any work on it until I get a reproducible case I can run. It
> > sounds like it should be fairly trivial to fix if I can find out what
> > (misinterpreted) characters are causing a freeze at what point in the
> > code.
>
> I think this should be reproducible with shared history file:
>
> 1. Type in an ISO-8859-1 terminal: echo zzà zz
> 2. In a UTF-8 terminal: history-incremental-search-backward then type z
Yes, I can see that. All that's really on offer with the wrong character
set is it doesn't hang...
Index: Src/Zle/zle_hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v
retrieving revision 1.63
diff -p -u -r1.63 zle_hist.c
--- Src/Zle/zle_hist.c 6 Sep 2009 21:37:14 -0000 1.63
+++ Src/Zle/zle_hist.c 18 Mar 2010 15:42:53 -0000
@@ -1454,6 +1454,8 @@ doisearch(char **args, int dir, int patt
memset(&mbs, 0, sizeof(mbs));
while (charpos < end_pos) {
ret = mb_metacharlenconv_r(zlemetaline + charpos, &wc, &mbs);
+ if (ret <= 0) /* Unrecognised, treat as single char */
+ ret = 1;
if (charpos <= pos && pos < charpos + ret)
isearch_startpos = charcount;
charcount++;
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author