GNU dd stops at the zero factor in a multiplier expression and never looks at
the rest. We now parse every factor first, so a huge one fails before the zero
is taken into account:
$ LC_ALL=C dd count=00x9999999999999999999999999999999999999999999999999999999999999 </dev/null
uutils: dd: invalid number: '00x999…': Value too large for defined data type
exit=1
GNU: 0+0 records in
0+0 records out
0 bytes copied, 1.627e-05 s, 0.0 kB/s
exit=0
This makes tests/dd/misc.sh fail.
It started with 7f9b9a6 ("dd: reject a number that does not fit in u64"),
which turned ParseSizeError::SizeTooBig into an error instead of u64::MAX
in parse_bytes_with_opt_multiplier. The zero factor case wasn't covered.
Note that fixing this alone doesn't make tests/dd/misc.sh pass the test then
reaches a second difference, dd: failed to seek in output file: Illegal seek.
Compared against GNU coreutils 9.10.
GNU
ddstops at the zero factor in a multiplier expression and never looks atthe rest. We now parse every factor first, so a huge one fails before the zero
is taken into account:
This makes
tests/dd/misc.shfail.It started with 7f9b9a6 ("dd: reject a number that does not fit in u64"),
which turned
ParseSizeError::SizeTooBiginto an error instead ofu64::MAXin
parse_bytes_with_opt_multiplier. The zero factor case wasn't covered.Note that fixing this alone doesn't make
tests/dd/misc.shpass the test thenreaches a second difference,
dd: failed to seek in output file: Illegal seek.Compared against GNU coreutils 9.10.