Repository navigation
tar: quote member names consistently in listings - #384
Open
SichenLiang wants to merge 1 commit into
Open
SichenLiang wants to merge 1 commit into
SichenLiang wants to merge 1 commit into
Conversation
Use one writer for plain and verbose listings. Quote invalid UTF-8 bytes, backslashes and control characters. In C, POSIX, or when all locale variables are unset or empty, quote every non-ASCII byte: café is printed as caf\303\251. Windows keeps ordinary non-ASCII names as text regardless of locale variables. Locale precedence skips empty LC_ALL, LC_CTYPE and LANG values. Other locale names use UTF-8 quoting, so non-UTF-8 locales and some Unicode printability cases remain outside this change.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #384 +/- ##
==========================================
- Coverage 96.84% 96.51% -0.34%
==========================================
Files 11 15 +4
Lines 1492 1951 +459
Branches 29 43 +14
==========================================
+ Hits 1445 1883 +438
- Misses 46 67 +21
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
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.
Use one byte-oriented writer for member names in both plain and verbose listings. It preserves spaces, quotes backslashes and common control characters with C escapes, and uses three-digit octal escapes for other control or invalid bytes.
Locale selection follows
LC_ALL,LC_CTYPE, thenLANG, ignoring empty values. InC,POSIX, or when all three are unset or empty, every non-ASCII byte is quoted. Other locale names use UTF-8 rules. Windows keeps ordinary Unicode text and quotes controls, backslashes, U+2028, and U+2029.This is local rather than using
uucore::quoting_stylebecause that helper escapes spaces, which tar listings must preserve. Enabling it would also add the ICU locale data dependency. The code can move to uucore later if the shared helper gains the behavior tar needs.Non-UTF-8 locales and some Unicode printability cases remain outside this change. #277 will need porting; the current #376 changes merge textually, and the merged result builds and passes the Linux tests.
Fixes #383