From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1619 invoked by alias); 8 Oct 2017 19:27:46 -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: 41829 Received: (qmail 10594 invoked by uid 1010); 8 Oct 2017 19:27:46 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-2.server.virginmedia.net 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(80.0.253.66):SA:0(-4.7/5.0):. Processed in 6.021661 secs); 08 Oct 2017 19:27:46 -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=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [86.21.219.59] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.1 cv=ELn7qAtC c=1 sm=1 tr=0 a=utowdAHh8RITBM/6U1BPxA==:117 a=utowdAHh8RITBM/6U1BPxA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=q2GGsy2AAAAA:8 a=HaHQWEm_nW4qrAGIuV0A:9 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 Date: Sun, 8 Oct 2017 20:20:32 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: [bug] sh: tilde expansion after field splitting Message-ID: <20171008202032.11ea7bf9@ntlworld.com> In-Reply-To: <171008005347.ZM1177@torch.brasslantern.com> References: <06fb6a91-6766-bbd7-9543-cbafe704ee59@inlv.org> <171008005347.ZM1177@torch.brasslantern.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1507490434; bh=heOTGnt6igZ1BB/m5xePt+8PHFsorw9d7ciyz1beZDs=; h=Date:From:To:Subject:In-Reply-To:References; b=WhVhVSPI5pWd1cH5TfkIspq/wTKuSJCa7vzzOT9NxtukFyLgBK2OBC7uEAxxAOQij uZjoPBgugzdEW4v1x8fs/+d6EFA8Nee3RBBiCvVu+F0RmjrRwS6LD81THFLIlhNBIb Sln/3SmB0oqXYFR7A0Rv4CkDuBvaFOSw002qcWbXaeHLH0SWiVEpCfxSo6T1jXGxDo UdV4fJorsoyPKC+SDd+toiRltPTG70bDvBvPRN1vMNxAL+KlHx3WjqoiFBUKsvytsF yxwrHhg+qu9IuIl9PjFA6blrt/2Rxcgzbf/EnlMkskI4abpVkh8mM40itMYFW6eRgw CGlOqvk4SvB9Q== On Sun, 8 Oct 2017 00:53:46 -0700 Bart Schaefer wrote: > On Oct 5, 12:20am, Martijn Dekker wrote: > } Subject: [bug] sh: tilde expansion after field splitting > } > } POSIX says tilde expansion should be done before parameter expansion [...] > } zsh did this correctly up to version 5.0.8; as of 5.1, it appears to do > } tilde expansion *after* field splitting, and only from the second field on. > > The patch below fixes this, I believe. Good, it sounds like the effect of the chunk you previous identified as related was simply moving the linked list node on as a side effect, or something like that. > - There either isn't a Test/ for the keyvalpairelement() case in the > first hunk below, or it isn't rigorous enough, because I initially > forgot the incnode(node) in that hunk, yet the shell did *not* go > into an infinite loop during "make check", nor did any test > fail That doesn't make sense. This is the only place where key / value pairs are handled and they require some sort of loop increment to work at all. You're basically claiming they only work by magic. > - Should we be testing isset(SHFILEEXPANSION) directly here, or ought > it instead be [for example] passed in the flags? Is it possible > that stringsubst() [second hunk] could toggle the setopt so that > the isset() in the third hunk inverts sense? Of course if that IS > possible, then the ultimate effect might be the expected one, and > this point is moot. I can't believe this is a big deal. > - Grepping Test/* doesn't find anything for SH_FILE_EXPANSION (in > upper/lower, with/without underscores, etc.). Did I miss it? > Does the test for the case in this thread belong in D04parameter > or E01options? Assuming SH_FILE_EXPANSION predates the test suite, I wouldn't be surprised if it's missing. pws