You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
realpath -m / readlink -m fail on a symlink loop #16325
With -m, GNU doesn't fail on a symlink loop, it just keeps the name. uutils errors out with "Too many levels of symbolic links".
cd "$(mktemp -d)"
ln -s b a; ln -s a b
realpath -m a # GNU: $PWD/a uutils: error, exit 1
realpath -m a/x # GNU: $PWD/a/x uutils: error, exit 1
readlink -m a # GNU: $PWD/a uutils: no output, exit 1
I'm not sure what the right fix is, though. Which name GNU keeps depends on the length of the loop: with p -> a added, realpath -m p gives $PWD/b. And on a loop that grows (foo -> foo/bar) GNU 9.11 on macOS never finishes, while uutils fails on purpose there (test_realpath_growing_loop). So I'm only reporting it, not sending a fix.
Activity
DeepakRoy58 commentedon Nov 16, 2026
hi, i would like to work on this. i will open a pr soon.