Repository navigation
find: escape special characters in -ls and -fls names, as GNU does - #935
jayhemnani9910 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #935 +/- ##
==========================================
- Coverage 92.79% 92.77% -0.03%
==========================================
Files 37 37
Lines 8038 8055 +17
Branches 403 403
==========================================
+ Hits 7459 7473 +14
- Misses 437 440 +3
Partials 142 142 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing |
-lsand-flsprint names as they are, so a name with a newline spans two lines and one with a space can't be told apart from two fields:GNU find writes them with
print_name_with_quoting(lib/listfile.c): a backslash before\, space and",\n\b\r\t\ffor those controls, and three octal digits for every other byte outside!..~. The link target after->gets the same. This is notls -b:"is escaped,\ais\007, and non-ASCII bytes are octal in any locale.-print,-printf %pand-print0still print names unchanged.New test
find_ls_escapes_special_characters_in_namesfails on main;cargo testpasses, clippy and fmt clean. The names above now print as GNU prints them.