summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2011-05-12 07:15:11 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2011-05-12 07:15:11 +0000
commitc99efe36da95f31d0b577d488095a9049bc75d42 (patch)
treed8b5c835d51eb6c46804c3191394e97fe202486a
parent293867e71ed9047108d998f6c0571ad2bd724c4f (diff)
When the max number of items for a directory has reached GLOB_LIMIT_READDIR
an error is returned but closedir() is not called. spotted and fix provided by Frank Denis obsd-tech@pureftpd.org ok otto@, millert@
-rw-r--r--lib/libc/gen/glob.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index 14fa957d539..2d63e5593c0 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glob.c,v 1.35 2011/01/12 01:53:14 djm Exp $ */
+/* $OpenBSD: glob.c,v 1.36 2011/05/12 07:15:10 pyr Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -687,7 +687,8 @@ glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend_last,
errno = 0;
*pathend++ = SEP;
*pathend = EOS;
- return(GLOB_NOSPACE);
+ err = GLOB_NOSPACE;
+ break;
}
/* Initial DOT must be matched literally. */