Fix canonicalize loop-detection corner case.
authorJim Meyering <jim@meyering.net>
Fri, 28 Sep 2007 21:26:49 +0000 (23:26 +0200)
committerJim Meyering <jim@meyering.net>
Fri, 28 Sep 2007 21:28:18 +0000 (23:28 +0200)
commit05552c43d21f272e927663aae4bc810e17d4d785
tree0868f84d03d2ce398fe31dc5f1ac0daf2ff821f2
parent2770108c4ac824e04367c336b520da21e595f1fe
Fix canonicalize loop-detection corner case.

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.
ChangeLog
lib/canonicalize.c
lib/hash-triple.c
lib/hash-triple.h