Skip to content

readlink: let the last of -e/-f/-m win - #16011

Open
Logic769 wants to merge 4 commits into
uutils:mainfrom
Logic769:readlink-last-of-efm-wins
Open

Logic769 wants to merge 4 commits into
uutils:mainfrom
Logic769:readlink-last-of-efm-wins

Conversation

@Logic769

@Logic769 Logic769 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GNU readlink uses whichever of -e, -f and -m appears last. uutils
let -e always take precedence, so readlink -e -f path behaved like -e
even though -f came last.

Declare the three options as overriding each other so the last one wins, and
add a test covering both orderings of -e and -f.

Closes #15995

@Logic769
Logic769 force-pushed the readlink-last-of-efm-wins branch 3 times, most recently from f3fa816 to 6c4d3d7 Compare November 3, 2026 15:43
@sylvestre
sylvestre force-pushed the readlink-last-of-efm-wins branch from 6c4d3d7 to 7a35b1b Compare November 6, 2026 11:34
@Logic769

Logic769 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

CI note (infrastructure issue, not related to the change in this PR):

The Tests job failed in the Doc-tests uucore step. The uucore unit tests themselves passed; the doctest compile then failed with error: extern location for ... does not exist: .../target/debug/deps/*.rlib and error[E0463]: can't find crate for ... (27–29 errors). The dependency .rlib files are missing from the restored target cache used by this run. The same failure is currently occurring on several unrelated PRs, so it is a repository CI/cache problem rather than this change. Re-running the job with a fresh build/cache rebuilds the artifacts.

No code changes in this PR are involved.

@sylvestre
sylvestre force-pushed the readlink-last-of-efm-wins branch from 7a35b1b to c17c492 Compare November 8, 2026 12:01
Comment thread src/uu/readlink/src/readlink.rs Resolved
Comment thread tests/by-util/test_readlink.rs Resolved
@sylvestre

Copy link
Copy Markdown
Contributor

thanks for picking this up!
The fix works, but the override list is pasted three times and -m has no test yet (details inline).

@sylvestre
sylvestre force-pushed the readlink-last-of-efm-wins branch from 8cb67b1 to c7558f0 Compare November 16, 2026 02:27

This branch has not been deployed

No deployments
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.

readlink: the last of -e / -f / -m should win

2 participants