Repository navigation
fix: keep the ./ prefix in {} placeholders for names that start with - - #2243
Merged
tmccombs merged 1 commit intoNov 28, 2026
Merged
Conversation
fd adds a `./` prefix to a path that starts with `-` so an `--exec` command
does not read it as an option. `remove_extension` stripped the prefix again,
so `{.}` turned `./-rf.jpg` into `-rf` and let a file name inject an option
into the command. It now keeps the prefix whenever the stripped name would
start with `-`, the same check `DirEntry::stripped_path` already does.
Closes sharkdp#2236
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
tmccombs
approved these changes
Nov 28, 2026
pei711
pushed a commit
to pei711/fd
that referenced
this pull request
Dec 1, 2026
…d names The fix for sharkdp#2236 landed in sharkdp#2243; this keeps the end-to-end CLI regression test from sharkdp#2246, rebased on current master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes 2236
fd adds a ./ prefix to a path that starts with a dash so an exec command does not read it as an option. remove_extension stripped that prefix again so the placeholder without the extension turned ./-rf.jpg into -rf
it now keeps the prefix when the stripped name would start with a dash. same check stripped_path already does
added two unit tests in src/fmt/input.rs for ./-rf.jpg and dir/-rf.jpg and a changelog line
165 unit tests pass. i could not run the integration tests here because they need symlink privileges on this windows box so they all fail at setup with error 1314 before running anything
checked by hand with the built binary in a temp dir. ./-rf.jpg now gives ./-rf and a normal file is unchanged