From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15981 invoked by alias); 11 Sep 2017 15:41:05 -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: 41675 Received: (qmail 3843 invoked by uid 1010); 11 Sep 2017 15:41:05 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.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(66.111.4.25):SA:0(-2.6/5.0):. Processed in 2.05959 secs); 11 Sep 2017 15:41:05 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=XoA+gV KlJkU38ofPIdZEg1YrQQKODTaAwFr8SxtUdNU=; b=T/tGUtBA0JHalju73dVNXH Hg9sbIHtJ4Be2V5ehfIF4OHdh2XxPoa9Hgw8kumX6y1t41vWqm/5MvHlfXwrmAUx ZMweeXiqPygPdk6YgDu0kAqANY/2B62e5KRYuPIC9ww9JcXmNLZANbs926UJJCAd BftRvmG5fw0TX7Fv8WcY1u61rOeSaF9/5rw4sb7aqp85IYIBK1CQ3N8xeuLYPYej GylK6tyobvl+1GP6th3umKlMYLylaiyrw8etpBKP8m/hsw/KWrXo5DEn+1GoLCc5 EpAdV5Dm8anITAzjAUKYhSqcuQ2qlrlzKROOTmh0DYYH4yzUFPYzeF30c1l6nPLQ == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=XoA+gV KlJkU38ofPIdZEg1YrQQKODTaAwFr8SxtUdNU=; b=GuHdGGHRQmKbPd5jIjeVr4 SfkebQVJ/dWPE7asfKDP6SmLSzw77YbGLvIZ6ySLoYd9NB1hYKRM1J9ew8Kv3dGw MSYLGnK7tb1xf+8nNAHv5O33sBFVL2bHBrwXqOH5pBIqTIBJUG0riaUiUTjpvtws pVvwezPVuLEhdLgH8OtQ5LhGrjzFhsUXewC/xmPoeTopZaHhQudUi4iG5v1XQp66 R7MAgt4+7Q0jNC5ivm+2YQnHYZOxfleLuY++Ww4l2Np8eVbzLIe7KV7ea9jFTaa/ lQTTSlD2sfykNXRqSB9USH/naC+fBN1zz86BpYQ97X483hh1AwI3/th+cPp9AS3w == X-ME-Sender: Message-Id: <1505144460.3897287.1102296144.050A283F@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-973d3087 Date: Mon, 11 Sep 2017 15:41:00 +0000 In-Reply-To: Subject: Re: zsh: RM_STAR warning counts files as though DOT_GLOB is set References: <20170911143436.GB1960@caska> <20170911150740.pz7fudj5lsflrmtk@tarpaulin.shahaf.local2> <1505143155.3891161.1102263072.1D722C8A@webmail.messagingengine.com> <20170911162337.630496ac@pwslap01u.europe.root.pri> Bart Schaefer wrote on Mon, 11 Sep 2017 08:31 -0700: > On Mon, Sep 11, 2017 at 8:23 AM, Peter Stephenson > wrote: > > On Mon, 11 Sep 2017 15:19:15 +0000 > > Daniel Shahaf wrote: > >> I don't understand the last branch of the if/else in that function: it > >> seems to prompt "... delete all the files ..." when count == 0? > > > > Apparently, yes. I think it's just covering the bases. > > The issue here, as I recall, is that it's possible to have: > 1 "rm *" is issued > 2 chkrmall() finds no files in the directory > 3 some external process creates a file > 4 "rm *" is executed > 5 the file created at (3) is silently deleted > > So we would need either to avoid re-expanding "*" after chkrmall(), or > treat "found no files" as "user answered no". Good catch. The warning messages emitted by the "if" and "else if" branches are all susceptible to this race condition. They were all added in 37946 in order to "make [the] warnings more informative". Simply reverting 37946 would resolve both the OP's problem and this race condition. (Just stating a fact; maybe there are other/better solutions) Cheers, Daniel