Rework r303074 case 4. Don't immediatelly skip directory entries which
cause MAXPATHLEN exceeded. Process them first through gl_errfunc() and GLOB_ERR.
This commit is contained in:
parent
6d1ffb50fc
commit
15cb786674
@ -803,6 +803,13 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
|
||||
}
|
||||
sc += clen;
|
||||
}
|
||||
if (too_long && ((pglob->gl_errfunc != NULL &&
|
||||
pglob->gl_errfunc(buf, ENAMETOOLONG)) ||
|
||||
(pglob->gl_flags & GLOB_ERR))) {
|
||||
errno = ENAMETOOLONG;
|
||||
err = GLOB_ABORTED;
|
||||
break;
|
||||
}
|
||||
if (too_long || !match(pathend, pattern, restpattern)) {
|
||||
*pathend = EOS;
|
||||
errno = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user