From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 664 invoked by alias); 18 Mar 2010 15:44:37 -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: 27804 Received: (qmail 11159 invoked from network); 18 Mar 2010 15:44:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Thu, 18 Mar 2010 15:44:24 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: zsh 4.3.10 history-incremental-search-backward freezes in UTF-8 Message-ID: <20100318154424.706b6c16@news01> In-Reply-To: <20100318152056.GO1761@prunille.vinc17.org> References: <20100318105005.GM1761@prunille.vinc17.org> <201003181430.o2IEUK3T011374@news01.csr.com> <20100318152056.GO1761@prunille.vinc17.org> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 18 Mar 2010 15:44:25.0004 (UTC) FILETIME=[E2CC6EC0:01CAC6B1] X-Scanned-By: MailControl A_09_30_00 (www.mailcontrol.com) on 10.68.0.118 On Thu, 18 Mar 2010 16:20:56 +0100 Vincent Lefevre 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. >=20 > I think this should be reproducible with shared history file: >=20 > 1. Type in an ISO-8859-1 terminal: echo zz=C3=A9 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D mb_metacharlenconv_r(zlemetaline + charpos, &wc, &mbs); + if (ret <=3D 0) /* Unrecognised, treat as single char */ + ret =3D 1; if (charpos <=3D pos && pos < charpos + ret) isearch_startpos =3D charcount; charcount++; --=20 Peter Stephenson 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, Cambr= idge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom