xxd: fix printing of trailing spaces

function                                             old     new   delta
bb_dump_dump                                        1497    1523     +26
xxd_main                                             459     466      +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0)               Total: 33 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2020-10-20 18:54:36 +02:00
parent 085f19cdff
commit dac5b83142
4 changed files with 105 additions and 56 deletions

View File

@ -141,6 +141,7 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
bb_dump_add(dumper, buf);
} else {
bb_dump_add(dumper, "\"\n\"");
dumper->eofstring = "\n";
}
return bb_dump_dump(dumper, argv);