Skip to content

find: print a trailing backslash in -printf - #881

Merged
sylvestre merged 1 commit into
uutils:mainfrom
SichenLiang:printf-trailing-backslash
Sep 28, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
SichenLiang:printf-trailing-backslash

Conversation

@SichenLiang

Copy link
Copy Markdown
Contributor

A trailing backslash in a printf format was treated as the start of an escape, so reaching the end of the format returned Unexpected EOF.

Print the backslash literally and issue the same warning as GNU findutils. The parser is shared by -printf and -fprintf, so both now behave the same way. Add a regression test for the trailing-backslash case.

Fixes #880

@SichenLiang
SichenLiang force-pushed the printf-trailing-backslash branch from b1e859a to ccc43ff Compare September 28, 2026 04:59
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (c1aeb11) to head (ccc43ff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #881      +/-   ##
==========================================
+ Coverage   92.26%   92.27%   +0.01%     
==========================================
  Files          35       35              
  Lines        7564     7576      +12     
  Branches      392      393       +1     
==========================================
+ Hits         6979     6991      +12     
  Misses        443      443              
  Partials      142      142              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Sep 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing SichenLiang:printf-trailing-backslash (ccc43ff) with main (c1aeb11)

Open in CodSpeed

@github-actions

Copy link
Copy Markdown

Commit ccc43ff has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 316 / PASSED: 273 / FAILED: 37 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: -1
  PASSED: -1
  FAILED: +0

No result in this run (1) - hung, crashed, or renamed:
  ? posix/flag_comma (was PASS)

@sylvestre
sylvestre merged commit f0b2ee9 into uutils:main Sep 28, 2026
23 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

find: -printf rejects a trailing backslash

2 participants