hexdump: fix short file of zero butes treated as dup

function                                             old     new   delta
bb_dump_dump                                        1466    1491     +25

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-07-03 16:27:54 +02:00
parent 9634e8a7d5
commit e5d5f5b9a7
2 changed files with 27 additions and 5 deletions

18
testsuite/hexdump.tests Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Copyright 2018 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "description" "command" "result" "infile" "stdin"
testing 'hexdump -C with four NULs' \
'hexdump -C' \
"\
00000000 00 00 00 00 |....|
00000004
" \
'' \
'\0\0\0\0'
exit $FAILCOUNT