]> git.ipfire.org Git - thirdparty/coreutils.git/commit
numfmt: support reading numbers with NBSP before unit
authorPádraig Brady <P@draigBrady.com>
Tue, 14 Oct 2025 15:17:56 +0000 (16:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 17 Oct 2025 16:26:25 +0000 (17:26 +0100)
commit8bc11f80a3eff1afec437383a63953e21a2063cd
treebacaa365f8152e3ec8a3cd283ee0d61f2c5e7ade
parentab5fce879b3ee372df7a0e2669587814d28cf57c
numfmt: support reading numbers with NBSP before unit

* src/numfmt.c (simple_strtod_human): Accept (multi-byte)
non-breaking space character between number and unit.
Note we restrict this to a single character between number
and unit, to allow less ambiguous parsing if multiple blanks
are used to delimit fields.
* tests/misc/numfmt.pl: Add test cases.
* doc/coreutils.texi (numfmt invocation): Fix stale description
--delimiter skipping whitespace.
* NEWS: Mention the improvement.
NEWS
doc/coreutils.texi
src/numfmt.c
tests/misc/numfmt.pl