From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10058 invoked from network); 23 Jan 2007 15:24:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) 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.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jan 2007 15:24:22 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 26748 invoked from network); 23 Jan 2007 15:24:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jan 2007 15:24:16 -0000 Received: (qmail 12110 invoked by alias); 23 Jan 2007 15:24:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23127 Received: (qmail 12101 invoked from network); 23 Jan 2007 15:24:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Jan 2007 15:24:11 -0000 Received: (qmail 26379 invoked from network); 23 Jan 2007 15:24:10 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 23 Jan 2007 15:24:03 -0000 Received: from torch.brasslantern.com ([71.116.79.148]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JCB0009EURMJGC2@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 23 Jan 2007 09:23:47 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id l0NFNjo4012123; Tue, 23 Jan 2007 07:23:45 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l0NFNiF6012122; Tue, 23 Jan 2007 07:23:44 -0800 Date: Tue, 23 Jan 2007 07:23:44 -0800 From: Bart Schaefer Subject: Re: Bug: Wrong completion of $(( $(!cmd In-reply-to: <200701231304.l0ND4b3t011195@news01.csr.com> To: Peter Stephenson , Zsh Hackers Message-id: <070123072344.ZM12121@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20070122234306.GA24536@primenet.com.au> <200701231304.l0ND4b3t011195@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Bug: Wrong completion of $(( $(!cmd" (Jan 23, 1:04pm) On Jan 23, 1:04pm, Peter Stephenson wrote: } } The problem is somewhere here (in lex.c). If dquote_parse() returns } non-zero it's an error indication, not a character, so the hungetc(c) } is definitely wrong in that case. I don't think that's true. If you look at the tail end of dquote_parse() you'll see that if lexstop is false the return value of dquote_parse() is overloaded -- it's both an error indication AND the most recently read character from the input stream. That's what hungetc() is trying to put back in that spot in cmd_or_math(). That doesn't make it correct, but that's what's going on. There must be (or have been at some past time) some other reason higher up the parse tree why that final character needed to be retained.