From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27225 invoked from network); 5 Jan 2004 17:09:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Jan 2004 17:09:05 -0000 Received: (qmail 8541 invoked by alias); 5 Jan 2004 17:08:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19337 Received: (qmail 8492 invoked from network); 5 Jan 2004 17:08:57 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Jan 2004 17:08:57 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [63.249.88.2] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Jan 2004 17:8:56 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id C093EE3DC; Mon, 5 Jan 2004 09:08:50 -0800 (PST) Date: Mon, 5 Jan 2004 09:08:50 -0800 From: Wayne Davison To: Peter Stephenson Cc: Zsh hackers list Subject: Re: zsh crashes on completeion of utf-8 file-names. Message-ID: <20040105170850.GB4482@blorf.net> References: <7460.1073312227@csr.com> <11091.1073318874@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11091.1073318874@csr.com> User-Agent: Mutt/1.5.4i On Mon, Jan 05, 2004 at 04:07:54PM +0000, Peter Stephenson wrote: > (By the way, every time I send a message saying I think setting lastval > = 0 in bin_eval is the correct fix for the eval "" bug, it disappears. > So let's see if tacking it on here confuses the system sufficiently.) Looks like you managed to fool it that time! I checked this in. > + l < len && l < md->len && p[ind] == q[ind] > + && (p[ind] != Meta || p[ind+1] == q[ind+1]); > l++, p += add, q += add); I think it would be more optimal to sanity-check the last value after the loop finishes, like this (untested): --- Src/Zle/compmatch.c 8 Aug 2001 07:41:01 -0000 1.37 +++ Src/Zle/compmatch.c 5 Jan 2004 17:03:07 -0000 @@ -1589,7 +1589,9 @@ l++, p += add, q += add); if (l) { - /* There was a common prefix, use it. */ + /* There was a common prefix, use it, but don't end on meta. */ + if (p[ind-add] == Meta) + l--; md->len -= l; len -= l; if (sfx) { md->str -= l; str -= l; ..wayne..