• Jim Meyering's avatar
    Fix canonicalize loop-detection corner case. · 05552c43
    Jim Meyering authored
    Do not attempt to stat the symlink values stored via seen_triple.
    Without this, coreutils' tests/misc/readlink-fp-loop test would fail
    on linux-2.6.18, (but not 2.6.22).
    * lib/canonicalize.c (seen_triple): Use triple_compare_ino_str, not
    triple_compare.  The former compares dev,ino,filename, while the latter
    would actually stat dirname(filename) when dev and ino were equal.
    * lib/hash-triple.c: Install <string.h>.
    (STREQ): Define.
    (triple_compare_ino_str): New function.
    * lib/hash-triple.h (triple_compare_ino_str): Declare it.
hash-triple.h 546 Bytes