]> Savannah Git Hosting - gnulib.git/commit
glob: simplify symlink detection
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 31 Aug 2017 21:34:24 +0000 (14:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 31 Aug 2017 22:08:44 +0000 (15:08 -0700)
commitb5ec983e132619034af6c7ddbb5d954887dbfeaf
treeec0c8d98f58c4adce247fdbc2a04c33de09e63a5
parenta20922f1055979e45de0a42a091f08009acfa99a
glob: simplify symlink detection

* lib/glob.c (dirent_type): New type.  Use uint_fast8_t not
uint8_t, as C99 does not require uint8_t.
(DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]:
New macros.
(struct readdir_result): Use dirent_type.  Do not define skip_entry
unless it is needed; this saves a byte on platforms lacking d_ino.
(readdir_result_type, readdir_result_skip_entry):
New functions, replacing ...
(readdir_result_might_be_symlink, readdir_result_might_be_dir):
... these functions, which were removed.  This makes the callers
easier to read.  All callers changed.
(D_INO_TO_RESULT): Now empty if there is no d_ino.
ChangeLog
lib/glob.c