Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Directory glob picks up running or already-run scripts on OS X
- X-seq: zsh-workers 38821
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] Directory glob picks up running or already-run scripts on OS X
- Date: Sun, 10 Jul 2016 21:58:21 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=5Sk0/JXXhse8izqXStXR6RYAT3jXAijmJEo6ACJaT88=; b=OfCIW9TFF3BLI1roQFxGHH75cfr/qObXTVkIhlxhPwfJJfmql4a8KeLF+jzhK2RhHO SAPUdVObWeCaQUicNkJZ+76QPE5bTd+G9ORn3XBdPLE73/FMmreszCdFyrAyesHRthIZ PFA5KlNVWyhUHAwx3XU68FXw1em63bw+gq5AkndAxzwZTlk0vWUAo9qmvoQeJDYxwjRm ods3e2gjIwFGZhvD4dEIetZZr7l5EiW+C3qjKOeqkpw3QHsYEkiqIMtBgJLh5YyWbt0J R+SBMFAsWksm5p8uVIelwmtRKnY2ioYDE+8e04Z9BGX7sSS9bcx0HBFJmwhtJA5cbFUh +KAg==
- In-reply-to: <6ED44F4D-7D51-4F0B-935D-4A3868E0C5C3@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CEE58D57-A237-4451-8882-0AE0CE21DD58@gmail.com> <CAH+w=7Y6GEJxa5LS4AeG5V5hsyUYJkSEEEMRnMSSJpLpRfLPXA@mail.gmail.com> <B17666ED-6D14-477C-B45D-3B7F064B5F24@gmail.com> <CAH+w=7Zr8T2b7hMhjj1K0oJ_KaWE2MBAfwBzmKnZzjOfvYjn5Q@mail.gmail.com> <6ED44F4D-7D51-4F0B-935D-4A3868E0C5C3@gmail.com>
I'm not sure whether this was introduced when adding the (Y) qualifier,
or if it was already lurking. With the following DPUTS() added and zsh
compiled with debugging, Test/D02glob.ztst will fail (on any platform).
diff --git a/Src/glob.c b/Src/glob.c
index 2051016..5260b63 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -318,6 +318,8 @@ insert(char *s, int checked)
char *news = s;
int statted = 0;
+ DPUTS(!s || !*s, "BUG: adding empty string as glob match");
+
queue_signals();
inserts = NULL;
The problem seems to be that scanner() calls recursively one extra
time when looking at "notadirectory/".
In that case statfullpath("") is called and, for reasons I haven't
figured out, that returns success on MacOS when called in exactly
the circumstances that Zhiming describes.
This will eventually correct itself, which leads me to suspect it has
something to do with re-using the global static "pathbuf".
The simple fix would be for insert() to be a no-op when called on the
empty string, but it might be useful to examine scanner() in more
detail to try to avoid the extra recursion.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author