]> Savannah Git Hosting - gnulib.git/commit
glob: fix symlink and // issues; improve speed
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Mar 2022 16:52:58 +0000 (09:52 -0700)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 22:56:45 +0000 (00:56 +0200)
commitf1c3b74220f74d25f968f1036fd3664cb0fb7f20
tree46be27161f910d6f08ce371cb328879d0fcf2769
parentfb314758cdd31b1cb953cbb9c975880458dc5a0e
glob: fix symlink and // issues; improve speed

* lib/glob.c: Include fcntl.h.
(dirfd) [_LIBC]: New macro.
(GLOB_STAT64, GLOB_LSTAT64): Remove.  Replace all uses with ...
(GLOB_FSTATAT64): ... this new macro.
(glob_in_dir): Treat DT_LNK like DT_UNKNOWN.
Use directory-relative fstatat unless GLOB_ALTDIRFUNC, or dirfd fails.
Avoid duplicate strlen (directory).
Work even if directory is "/", without turning it into "//".
Use a scratch buffer instead of by-hand alloca stuff.
Use mempcpy and memcpy instead of stpcpy and strcpy.
* modules/glob (Depends-on): Add dirfd, fstatat.  Remove stat.
(License): Change from LGPLv2+ to GPL, since it depends on
fstatat.
ChangeLog
lib/glob.c
modules/glob