mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
dd: warn about counts specified with confusing 0x prefix
* src/dd.c (parse_integer): Suggest to use "00x" instead of "0x", which is significant for the "count", "seek", and "skip" operands. * tests/dd/misc.sh: Add a test case. Fixes http://bugs.gnu.org/24874
This commit is contained in:
@@ -107,4 +107,14 @@ compare err_ok err || fail=1
|
||||
|
||||
test $fail -eq 0 && fail=$warn
|
||||
|
||||
# Check a warning is issued for ambiguous 0x... numbers
|
||||
dd if=/dev/null count=0x1 seek=0x1 skip=0x1 status=none 2>err || fail=1
|
||||
cat <<\EOF >exp
|
||||
dd: warning: '0x' is a zero multiplier; use '00x' if that is intended
|
||||
dd: warning: '0x' is a zero multiplier; use '00x' if that is intended
|
||||
dd: warning: '0x' is a zero multiplier; use '00x' if that is intended
|
||||
EOF
|
||||
compare exp err || fail=1
|
||||
|
||||
|
||||
Exit $fail
|
||||
|
||||
Reference in New Issue
Block a user