]> git.ipfire.org Git - thirdparty/coreutils.git/commit
numfmt: fix issues with multi-byte blanks
authorPádraig Brady <P@draigBrady.com>
Fri, 17 Oct 2025 18:14:21 +0000 (19:14 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 18 Oct 2025 17:37:10 +0000 (18:37 +0100)
commit770078e315232b49c0e113152a469df4df1e5f4d
tree0ffe185e150fa6c535be468d614b5c6448b9c44b
parent0f7babad383547c182bd85e97ff497edd11f6c20
numfmt: fix issues with multi-byte blanks

* src/numfmt.c (process_line): Restore byte overwritten with NUL,
as it may be part of a multi-byte blank.
(process_suffixed_number): Skip multi-byte blanks,
and correctly determine width with mbswidth().
(parse_format_string): Use c_isblank() to explicitly
indicate that's all the format spec supports.
* tests/misc/numfmt.pl: Add test cases.
* NEWS: Mention the bug fix.
NEWS
src/numfmt.c
tests/misc/numfmt.pl