summaryrefslogtreecommitdiff
path: root/Src/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 43d135b99..fa3ce25f4 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -634,8 +634,10 @@ scanner(Complist q, int shortcircuit)
} else {
/* if the last filename component, just add it */
insert(fn, 1);
- if (shortcircuit && shortcircuit == matchct)
+ if (shortcircuit && shortcircuit == matchct) {
+ closedir(lock);
return;
+ }
}
}
}