1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

Reset errno for readdirfunc() before contunue.

This commit is contained in:
Andrey A. Chernov 2016-07-30 02:09:11 +00:00
parent 999c1fd64b
commit e04d8562b6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303530

View File

@ -781,8 +781,10 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
}
/* 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 *pathend_last,
}
if (too_long || !match(pathend, pattern, restpattern)) {
*pathend = EOS;
errno = 0;
continue;
}
err = glob2(pathbuf, --dc, pathend_last, restpattern,