From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15762 invoked by alias); 12 Oct 2017 15:26:44 -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: 41869 Received: (qmail 11917 invoked by uid 1010); 12 Oct 2017 15:26:44 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f180.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.180):SA:0(-1.4/5.0):. Processed in 2.897001 secs); 12 Oct 2017 15:26:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=i7z1XxVYBYYFJoH3bc4oRGnETMEmTtqtL78lsJrKdaM=; b=xvFIqsQbx4MX6DOwwD+nR2W6Muk9ojrcCxkhzTENmWSgUBeMwawKrSOQe12DvId4+d OKIdhm2pP81PYcmGRwpQSXvTvMUmXEB/pmbEjdyXaYEKTzqbsuvpVuZcr5qi7vG8zlLZ aDRjB1JYfX8Qk90+qUVjcv57eGv0RiqOBGPNZtM5JaM0HvpCU061YTQ66aSIcOe1uWaN GdWB4FMPL5q7kFIUpdA37FszLZUj0INhbe3LETGyjfXSeDAVg4SCYxYvUoMyynUnBNdL maKj4oN7KRlA1u0HcpOEqmnAJM8Lt1TH0X8mMV9MSsGsfCDGfrCMneFU1eS6rn2tr+Q9 8JQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=i7z1XxVYBYYFJoH3bc4oRGnETMEmTtqtL78lsJrKdaM=; b=Z3F/jV4vMWYkJZuc1qvyS6EoEKSvhB4xOesLv0FkQAVWYDXVosNO2oZrg67T2vX1n/ nHrbdu2wHvNjZVw0JB5oR61oVkJNQzt+VlJeoYqCrCOc416wOC0Hv1VazrnGhalpKDAA JGM9ywg++9281Wi8RGTIDGLCzWQcVWenFaL5etU1d+qgk4O8HAcUd9XvpqcEYw6xT7ha 9ovV9RjT+/ERWwQkcv/zS8upGdpPDPJbK8yRjW1H9P5D/OEFVBo2j/45g9RS+WZP81Fm V4EbeYr8VTj09PkS/wtVGQmbnQJICu/s36pNzcyyC/HQ//GODNh9z1XmeFlGfSjnjXzk knVA== X-Gm-Message-State: AMCzsaXQrX+kS4DHgiH4hPLBvn7YG+AT6GvEFeEWURI7sMzXnZS/edEu KbRYJ6ohp8DUVtcNjxSW+hkKpTZFowopICf8Irmz5X9+ X-Google-Smtp-Source: AOwi7QDgvWLsJPWFjS1/V3txPWJZv4pFXSby6MYcouQROFyKk8sXIboS0orQ5BrQo/nxieHuestoqgxl46gbVIRvYgc= X-Received: by 10.237.42.131 with SMTP id t3mr4032777qtd.188.1507821997160; Thu, 12 Oct 2017 08:26:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <171011100231.ZM3821@torch.brasslantern.com> From: Bart Schaefer Date: Thu, 12 Oct 2017 08:26:35 -0700 Message-ID: Subject: Re: [BUG] In reference to patch 39815, about (z) flag and $( parse error To: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 12, 2017 at 7:54 AM, Sebastian Gniazdowski wrote: > On 11 pa=C5=BAdziernika 2017 at 19:02:31, Bart Schaefer (schaefer@brassla= ntern.com) wrote: >> Hmm, so the problem appears to be that when parsing a comment, we >> actually need the NEWLIN token to mark the end of the comment. >> When parsing code, we need NEWLIN to be ignored as whitespace and >> not tokenized. > > Have you any possible places for the fix? It'd most likely need to be in bufferwords(), which somehow needs to know that the STRING token returned from the lexer is [or not] a comment and that therefore it should [or not] ignore the subsequent NEWLIN. However, that cascades all the way down into gettok() which is where the "#" character is recognized and everything from there up to but not including the newline is consumed. > I've ran bisect, and the "<=3D 5.0.6 doesn't have Z+cn+ problem" holds up= to this patch: > > commit c0d01a6fe0c67911650730cf13a2b9a0db16e59b > Date: Tue Jan 6 17:05:17 2015 +0000 > > Fix command substitutions to parse contents as they are read in. (PWS, it would be helpful if you could include workers article numbers in your commit logs.) That commit is this: * 34160: Src/init.c, Src/input.c, Src/lex.c, Src/parse.c, Src/zsh.h, Test/D08cmdsubst.ztst: fix the problem that command and similar substitutions weren't properly parsed so could end prematurely. Use improved resolution in context save and restore to allow parsing the substitution while tracking the string. So it's not that 5.0.6 was correct, it's that we've swapped one problem [that affects more than just (Z:n:)] for another.