svn commit: r303530 - head/lib/libc/gen

Andrey A. Chernov ache at FreeBSD.org
Sat Jul 30 02:09:13 UTC 2016


Author: ache
Date: Sat Jul 30 02:09:11 2016
New Revision: 303530
URL: https://svnweb.freebsd.org/changeset/base/303530

Log:
  Reset errno for readdirfunc() before contunue.

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==============================================================================
--- head/lib/libc/gen/glob.c	Sat Jul 30 01:16:06 2016	(r303529)
+++ head/lib/libc/gen/glob.c	Sat Jul 30 02:09:11 2016	(r303530)
@@ -781,8 +781,10 @@ glob3(Char *pathbuf, Char *pathend, Char
 		}
 
 		/* Initial DOT must be matched literally. */
-		if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT)
+		if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) {
+			errno = 0;
 			continue;
+		}
 		memset(&mbs, 0, sizeof(mbs));
 		dc = pathend;
 		sc = dp->d_name;
@@ -803,6 +805,7 @@ glob3(Char *pathbuf, Char *pathend, Char
 		}
 		if (too_long || !match(pathend, pattern, restpattern)) {
 			*pathend = EOS;
+			errno = 0;
 			continue;
 		}
 		err = glob2(pathbuf, --dc, pathend_last, restpattern,


More information about the svn-src-head mailing list