Description
readlink -f returns exit code 0 with empty output for cyclic symlinks, whereas GNU coreutils returns exit code 1.
Steps to reproduce
ln -sf cyclic-test /tmp/cyclic-test
readlink -f /tmp/cyclic-test
echo "exit code: $?"
rm -f /tmp/cyclic-test
Expected behavior (GNU coreutils)
(empty output)
exit code: 1
Actual behavior (uutils)
(empty output)
exit code: 0
Impact
This breaks Emacs Tramp's file-truename implementation, which uses readlink -f and checks the exit code to detect failures. When the command "succeeds" with empty output, Tramp interprets the empty string as the truename, leading to incorrect behavior for cyclic symlinks.
Version
uutils 0.0.29 (Arch Linux)