Skip to content

fix: always error on patterns containing path separators#1930

Closed
qianchongyang wants to merge 1 commit intosharkdp:masterfrom
qianchongyang:bounty/20260318-sharkdp-fd-1873
Closed

fix: always error on patterns containing path separators#1930
qianchongyang wants to merge 1 commit intosharkdp:masterfrom
qianchongyang:bounty/20260318-sharkdp-fd-1873

Conversation

@qianchongyang
Copy link
Copy Markdown

Problem

fd only shows the "pattern contains path separator" error when the pattern also happens to be an existing directory. In all other cases it silently returns no results, which is inconsistent and confusing.

Solution

Remove the directory existence check so any pattern containing a path separator triggers the same guidance unless --full-path is used.

Validation

  • Reviewed the existing path validation branch
  • Verified the patch is a minimal logic change in src/main.rs
  • Full cargo build/test could not be run on the Oracle host because the Rust toolchain is not installed there

Fixes #1873

…stence

Previously, the error about '/' in pattern was only shown when the
pattern was also an existing directory. Now it shows consistently
regardless of whether the path exists.

Fixes sharkdp#1873
@tmccombs
Copy link
Copy Markdown
Collaborator

This doesn't address #1873 (comment).

@tmccombs tmccombs closed this Mar 29, 2026
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.

[BUG] The 'pattern contains path separator' error is only shown when pattern is an existing directory

2 participants