Skip to content

diff: keep an exact-name dangling symlink with --ignore-file-name-case - #377

Open
binhvq wants to merge 5 commits into
uutils:mainfrom
binhvq:ignore-case-exact-dangling-link
Open

binhvq wants to merge 5 commits into
uutils:mainfrom
binhvq:ignore-case-exact-dangling-link

Conversation

@binhvq

@binhvq binhvq commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #357.

directory_entry used Path::exists(), which follows symlinks, so a dangling symlink with the exact name counted as missing and a case variant was compared instead. Use symlink_metadata().

The bug only shows when the directory lists the case variant before the link (tmpfs lists newest first, btrfs oldest first), so the test builds both layouts.

For 'diff FILE DIR' the entry of DIR was looked up with Path::exists(), which follows symlinks. A dangling symlink named exactly like FILE counted as missing, and a differently cased entry was compared instead when the directory listed it first.
…gling-link

# Conflicts:
#	tests/by-util/test_diff.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diff - --ignore-file-name-case picks a case variant over an exact-name dangling symlink

1 participant