From 691a7e4b3d106bbc899bacbce20d1be9865b6598 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Thu, 25 Sep 2014 19:12:34 +0100
Subject: users/19143: fix depth glob search with trailing slashes
---
Src/glob.c | 3 +++
1 file changed, 3 insertions(+)
(limited to 'Src/glob.c')
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 == '/') {
--
cgit 1.4.1