From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26572 invoked from network); 4 Oct 2005 04:40:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Oct 2005 04:40:07 -0000 Received: (qmail 26455 invoked from network); 4 Oct 2005 04:40:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 04:40:01 -0000 Received: (qmail 24825 invoked by alias); 4 Oct 2005 04:39:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21822 Received: (qmail 24816 invoked from network); 4 Oct 2005 04:39:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Oct 2005 04:39:56 -0000 Received: (qmail 26132 invoked from network); 4 Oct 2005 04:39:56 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 04:39:54 -0000 Received: from candle.brasslantern.com ([71.116.81.225]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0INT00CFAJMGZKB4@vms048.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 03 Oct 2005 23:39:53 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j944dpQY030572 for ; Mon, 03 Oct 2005 21:39:51 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j944dpuv030571 for zsh-workers@sunsite.dk; Mon, 03 Oct 2005 21:39:51 -0700 Date: Tue, 04 Oct 2005 04:39:50 +0000 From: Bart Schaefer Subject: PATCH? - Re: Bug? in complist when filenames are longer than the screen In-reply-to: <1051004020717.ZM5616@candle.brasslantern.com> To: Zsh Workers Message-id: <1051004043950.ZM30570@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20051003144536.GA3179@DervishD> <200510032145.07748.arvidjaar@newmail.ru> <20051003184822.GA3240@DervishD> <1051004020717.ZM5616@candle.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Bug? in complist when filenames are longer than the screen" (Oct 4, 2:07am) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Oct 4, 2:07am, Bart Schaefer wrote: } } I don't really know what the problem is I still don't know what the problem is, but I have a reproducible infinite loop. Use a PS1 string at least 10 characters long, and make the window narrower than 12 characters, so that the first completion filled in on the command line by menu-completion is forced to wrap to the next line of the screen. Then begin doing menu completion with listing. When the completion reaches the end of the list and wraps back to the first entry, zsh goes into an infinite loop attempting to compute the *line* on which to begin redrawing. The following prevents the infinite loop, but is almost certainly not the best patch. However, I don't understand this code well enough to produce a better one. It should be possible to apply this patch after my "defensive" one, though all those defenses against looping on the column count were of no help when the actual loop was on the line count. --- current/Src/Zle/complist.c Mon Oct 3 21:15:31 2005 +++ Src/Zle/complist.c Mon Oct 3 21:25:34 2005 @@ -2154,8 +2154,11 @@ mline = y; } while (mline < mlbeg) - if ((mlbeg -= step) < 0) + if ((mlbeg -= step) < 0) { mlbeg = 0; + if (mline < 0) + break; + } if (mlbeg && lbeg != mlbeg) { Cmatch **p = mtab + ((mlbeg - 1) * columns), **q;