about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2014-09-25 19:12:34 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-09-25 19:12:34 +0100
commit691a7e4b3d106bbc899bacbce20d1be9865b6598 (patch)
tree6537b8de9c8714f44505eab46b152d792ca2b06c /Src/glob.c
parentd9a059eb3af9f538d84e63aabe90e5321971dc07 (diff)
downloadzsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.tar.gz
zsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.tar.xz
zsh-691a7e4b3d106bbc899bacbce20d1be9865b6598.zip
users/19143: fix depth glob search with trailing slashes
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c3
1 files changed, 3 insertions, 0 deletions
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 == '/') {