From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2218 invoked from network); 12 Dec 2005 18:46:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Dec 2005 18:46:29 -0000 Received: (qmail 79138 invoked from network); 12 Dec 2005 18:46:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Dec 2005 18:46:23 -0000 Received: (qmail 25608 invoked by alias); 12 Dec 2005 18:46:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22073 Received: (qmail 25599 invoked from network); 12 Dec 2005 18:46:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Dec 2005 18:46:20 -0000 Received: (qmail 78835 invoked from network); 12 Dec 2005 18:46:20 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 12 Dec 2005 18:46:19 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 42A15715D; Mon, 12 Dec 2005 10:46:18 -0800 (PST) Date: Mon, 12 Dec 2005 10:46:18 -0800 From: Wayne Davison To: "Jun T." Cc: zsh-workers@sunsite.dk Subject: Re: 4.3.0-dev-2 BUG: negative cursor position Message-ID: <20051212184618.GA7116@dot.blorf.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 On Mon, Dec 12, 2005 at 11:14:05PM +0900, Jun T. wrote: > Is this the right place to report a zsh bug? Yes, this is a very good place for that. > With gdb, I found that zlecs becomes negative at line 674 of zle_hist.c. Good catch -- that code is new for 4.3.x: it's a slightly optimized version of some setline() code, but the check to see if zlecs was non- zero was accidentally dropped from the algorithm. I've checked in a fix. Note that your suggested fix will work just fine, but I ended up using a slightly different check (taken from setline()) where it just checks zlecs against 0 instead of calling findbol(). Thanks for the report, ..wayne..