diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2014-09-25 19:12:34 +0100 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2014-09-25 19:12:34 +0100 |
commit | 691a7e4b3d106bbc899bacbce20d1be9865b6598 (patch) | |
tree | 6537b8de9c8714f44505eab46b152d792ca2b06c | |
parent | d9a059eb3af9f538d84e63aabe90e5321971dc07 (diff) | |
download | zsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.tar.gz zsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.tar.xz zsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.zip |
users/19143: fix depth glob search with trailing slashes
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/glob.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index f63bb8a12..a3e72e3e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-09-25 Peter Stephenson <p.w.stephenson@ntlworld.com> + + * users/19143: Src/glob.c: **/*(odonT) didn't work because + the trailing slash wasn't properly ignored. + 2014-09-25 Peter Stephenson <p.stephenson@samsung.com> * unposted: NEWS: tweak last change. diff --git a/Src/glob.c b/Src/glob.c index c24bfec93..ca7bc4410 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -900,6 +900,9 @@ gmatchcmp(Gmatch a, Gmatch b) /* Count slashes. Trailing slashes don't count. */ while (*aptr && *aptr == *bptr) aptr++, bptr++; + /* Like I just said... */ + if ((!*aptr || !*bptr) && aptr > a->name && aptr[-1] == '/') + aptr--, bptr--; if (*aptr) for (; aptr[1]; aptr++) if (*aptr == '/') { |