• Paul Eggert's avatar
    glob: match dangling symlinks · fd1daf4e
    Paul Eggert authored
    This fixes a bug I inadvertently introduced to Gnulib when I
    merged glibc glob back into gnulib on 2007-10-16.  This fix is
    inspired by a patch proposed for glibc by Adhemerval Zanella in:
    https://sourceware.org/ml/libc-alpha/2017-08/msg00446.html
    * doc/posix-functions/glob.texi: Update list of affected platforms.
    * lib/glob.c (__lstat64): New macro.
    (is_dir): New function.
    (glob, glob_in_dir): Match symlinks even if they are dangling.
    (link_stat, link_exists_p): Remove.  All uses removed.
    * lib/glob.in.h (__attribute_noinline__): Remove; no longer used.
    * m4/glob.m4 (gl_PREREQ_GLOB): Do not check for fstatat.
    * modules/glob (Depends-on): Remove dirfd.
    * modules/glob-tests (Depends-on): Add symlink.
    * tests/test-glob.c: Include errno.h, unistd.h.
    (BASE): New macro.
    (main): Test dangling symlinks, if symlinks are supported.
    fd1daf4e