stat: print "Block size" in file system mode - #14188
Open
Socialpranker wants to merge 2 commits into
Open
Conversation
In `stat -f` the label was composed from two separate words, which rendered as "Block Size:". GNU prints "Block size:", so the label is now a single localizable string. As a side effect the French output becomes "Taille bloc:" instead of the word-by-word "Bloc Taille:".
|
GNU testsuite comparison: |
`stat -f` panics with `unimplemented!()` in `fs_type` on the other unix targets, so the test failed on the OpenBSD leg of the unix job.
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.
stat -fbuilds its second line out of two independent word translations,stat-word-block(Block) andstat-word-size(Size), so the label comesout capitalized on both words:
GNU prints
Block size:there — lowercases, one label rather than twowords. Everything else on the line, including the
%-10spadding and theFundamental block size:label that follows, already matches.This PR replaces the
Block+Sizepair with a single localizable key,stat-word-block-size-capitalized. Composing a label out of separate words isalso a translation hazard: the French locale currently renders
Bloc Taille:,and with the label as one string it becomes
Taille bloc:. The existingstat-word-blockandstat-word-sizekeys stay — they are still used forIO Block:andSize:in the non--fformat.Testing: new
test_fs_default_format_block_size_labelintests/by-util/test_stat.rsasserts the label; it fails on currentmainandpasses with this change (verified by reverting
stat.rsand the locales aloneand re-running). The full
statsuite is green (33 passed),cargo fmt --all --checkandcargo clippy -p uu_stat --all-targetsareclean. A release build of this branch was also compared against the system
statinsidedebian:stable-slimfor/,/etc,/etc/passwd,/tmp,/procand/dev— 6 of 6 byte-identical, where before all six differed onthis line.
Behaviour was established by observing GNU
stat's output on a Debian system —no GNU source was consulted.