Bug report from luckboy: rm -f on a broken symlink didn't work because our "does it exist" test (to avoid errors on rm -f of nonexistent files) said it didn't.

The fix: replace the access() with unlink(), which produces the same "does not
exist" errno and has the added bonus of acting as a fastpath for rm -f on
non-directories. (And since it produces a different error on directories,
falls through to the old behavior there.)

Most of this commit is comment updates explaining being subtle. :)
1 file changed