find: -printf %h drops a doubled slash

Open Beginner friendly
#952 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@qodelicious is already working on this.

Since Nov 6, 2026.

  • #953 by @qodelicious — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start at the implementation of find's -printf %h format, then inspect related tests for path components and repeated slashes; the payload names no files or test paths. Reproduce with the supplied d// examples and compare %h|%f|%p with GNU find 4.10. Done when %h preserves the doubled slash so %h/%f matches %p in these cases.

Written by the indexing model from the issue text.

Description

With a starting point like d//, %h loses one of the slashes, so %h/%f no longer matches %p.

$ mkdir -p d/sub
$ find d// -mindepth 1 -printf '%h|%f|%p\n'
d/|sub|d//sub

GNU find 4.10 prints d/ for %h there, and find d//sub -printf '%h\n' also gives d/. uutils find prints d in both cases.

Dominant language
Rust
Stars
653
Forks
115
Avg merge
1d 4h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/findutils

All issues in uutils/findutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.