Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=from:content-transfer-encoding:subject:message-id:date:to
         :mime-version;
        bh=qyv3qGP6kJbgSCmBSFmCyeak0RPW4tIVUjE2BWwEKps=;
        b=QKZAXiv0z1d9P8o38hfb1vRrayUepeSzRF2+L6JO8fjNWCIaQ7CwsbqKk3vbCwj4u1
         7DQdmYTsGp6Sz5NCLbPo7W2flsr4wIHvpJylwDkj+kjxRB8YZjFkqF/Q/sHVFO+POFP/
         i2qYH1cUcoaajdPor7LbnrVR+erxpxpAt5OrbMHtrrkL1Ic8kRRlCjhZ4ki7DK1pCbx9
         aV3JMdb60aLkV+n9iL0VoG5Q4RlwutlAfOKMGZAuFG6YufzV2gpjX4NEy4BkL5CwpUiQ
         UUAu8dYQgGzOvHjnmdEliH6FfS0Xy8gtxWYtSg7B+SQXJp/Qrj7KJ7Ixvh3ec0aktaNe
         H46A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-transfer-encoding:subject
         :message-id:date:to:mime-version;
        bh=qyv3qGP6kJbgSCmBSFmCyeak0RPW4tIVUjE2BWwEKps=;
        b=AOh3UjYJbuE3uSypvWUUOylyObj6AnPDqLmH1pBcdaKYP7Rr15KqzLmsVi0Qz+B53n
         MYNI7uZj9XtDnwC/Z7v2fNI4UcfbpPn6RG2W+LbGU2KyiwtuCExePtfECiO9RIGyIsVB
         pDz7X4VnW1TZdHCehEx/2wwTmD40olF9DG9Q8YwKrmgTxd6EkmfyO2eTUr9oCxthmAf9
         Tg+eLiIXpmZBUUmMNXKWoEVPMQgPuiNMVx0tTg7EgXD5AVIpIf0h6tEzEQXwwdo6p9n0
         vrvAHzIkvx+vcsoZg7gOYroPUN/vMLf2a9pDuX1zKCRbs7p3M0WP6v43CbLpgVGcBTX7
         tOLQ==
X-Gm-Message-State: ALyK8tKXchH8QQnJxN6dvWMKtgk8DE0dX/UvKgP+b/gIem/vm8nnvNdUix62cHTOuF/1XQ==
X-Received: by 10.98.15.212 with SMTP id 81mr15478033pfp.110.1468036515793;
        Fri, 08 Jul 2016 20:55:15 -0700 (PDT)
From: Zhiming Wang <zmwangx@gmail.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: [BUG] Directory glob picks up running or already-run scripts on OS X
Message-Id: <CEE58D57-A237-4451-8882-0AE0CE21DD58@gmail.com>
Date: Sat, 9 Jul 2016 11:55:05 +0800
To: zsh-workers@zsh.org
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
X-Seq: zsh-workers 38815

With zsh 5.2 or master running on OS X 10.11.5 or macOS 10.12 PB1, a =
glob for
directories could pick up scripts that are either running or have been
run. Note that this seems to only apply to scripts, not random =
executables
(e.g., an executable created by a C compiler). Here's a session that =
reproduces
the issue:

    $ cd $(mktemp -d)
    $ print '#!/usr/bin/env zsh' >script1
    $ print $'#!/usr/bin/env zsh\nprint -l */' >script2
    $ chmod +x script1 script2
    $ print -l */
    zsh: no matches found: */
    $ ./script1
    $ print -l */
    script1/
    $ ./script2
    script1/
    script2/
    $ print -l */
    script1/
    script2/
    $ print $'#include <stdio.h>\nint main() { printf("hello, world"); =
}' >hello.c
    $ cc -o hello hello.c
    $ ./hello
    hello, world%
    $ print -l */
    script1/
    script2/

I cannot reproduce this issue with zsh 5.0.8 on OS X, so something went =
wrong
in between. Unfortunately, due to some limitations I cannot test other =
versions
right now. I also cannot repoduce this issue on Linux with any zsh =
version
(including 5.2 or master), so this seems to be an OS X specific issue.=

