From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14206 invoked by alias); 19 Nov 2013 17:52:42 -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: 32026 Received: (qmail 14566 invoked from network); 19 Nov 2013 17:52:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7fe66d00000432e-d5-528ba5619c69 Date: Tue, 19 Nov 2013 17:52:32 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Recent regression on (N) after removing array element Message-id: <20131119175232.16fe2af9@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Vd3Epd1BBhNabCwONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXRlvXXqaC++wVx14eYmlg7GDrYuTkkBAwkVjy+iuULSZx4d56 MFtIYCmjxOI9Ul2MXED2ciaJn68uM4MkWARUJa7/WAFmswkYSkzdNJsRxBYREJc4u/Y8C4gt LOAk8eT3eXYQm1fAXmLT0XWsIDanQLDEojPTmCAWBEi83DEXLM4voC9x9e8nJogj7CVmXjnD CNErKPFj8j2wmcwCWhKbtzWxQtjyEpvXvGWewCgwC0nZLCRls5CULWBkXsUomlqaXFCclJ5r pFecmFtcmpeul5yfu4kREoJfdzAuPWZ1iFGAg1GJh1diQXeQEGtiWXFl7iFGCQ5mJRHemnqg EG9KYmVValF+fFFpTmrxIUYmDk6pBkb1eX6Jnu9cdk4LWL1y+m/hPLnFjyZ6dkctnnkzahej qE6Y9MMI2zllczX33/657nq6+p43lwrPhvIsTrKdXTS/uNp655LjNa25+3Rr7udcC/zCz3eC 4XXKbr+dxVO2pmz3vfVIMaTi+J2Trw3y/PzKm7SObTuQ/CCnLXbFw01v5Y+9cz8eor1OiaU4 I9FQi7moOBEAd4R2Bh8CAAA= On Tue, 19 Nov 2013 12:08:04 -0500 Vin Shelton wrote: > This used to work: > > x=( /bin /foo ) > x[(r)/foo]='' > x=( $^x(N) ) > > but the last line now yields an error: > zsh: no matches found: (N) > > If I remove this recent change to Src/glob.c, (N) works correctly: What we didn't think of was glob qualifiers that transformed a failed match in some way. Although the empty string isn't a valid file name, it is a valid failed match for a file name. It's quite hard to see how to improve the test so that we can still check for something before the (N). By the time globbing comes along, it's already been expanded to a bare (N), so we can't see that the user originally had something in front. Apart from going back to the original, the only ways round that occur to me involve reparsing on failure, e.g. reinterpreting as glob qualifiers if no matches were found. But that's probably worse than the original disease. pws