diff options
author | Denys Vlasenko | 2017-01-25 17:00:38 +0100 |
---|---|---|
committer | Denys Vlasenko | 2017-01-25 17:00:38 +0100 |
commit | 7dd906a3884a31458d30fc43eb9885c5adf4bbea (patch) | |
tree | fb2abc48a0d8aff2a7147e28241408286c0c337b | |
parent | 62a9b18547462a657ffb18cf03d5cfdcf774c905 (diff) | |
download | busybox-7dd906a3884a31458d30fc43eb9885c5adf4bbea.zip busybox-7dd906a3884a31458d30fc43eb9885c5adf4bbea.tar.gz |
xxd: make -p output lines actually end with a newline
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/hexdump_xxd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c index cc34ea6..be4b4f3 100644 --- a/util-linux/hexdump_xxd.c +++ b/util-linux/hexdump_xxd.c @@ -129,7 +129,7 @@ int xxd_main(int argc UNUSED_PARAM, char **argv) } // for -g3, this results in B B BS B B BS... B = "xxxxxx xxxxxx .....xx" // todo: can be more clever and use - // one "cols-1/B" format instead of many "B B B..." formats + // one 'bytes-1/1 "%02x"' format instead of many "B B B..." formats //bb_error_msg("ADDED:'%s'", bigbuf); bb_dump_add(dumper, bigbuf); free(bigbuf); @@ -138,6 +138,8 @@ int xxd_main(int argc UNUSED_PARAM, char **argv) if (!(opt & OPT_p)) { sprintf(buf, "\" \"%u/1 \"%%_p\"\"\n\"", cols); // " ASCII\n" bb_dump_add(dumper, buf); + } else { + bb_dump_add(dumper, "\"\n\""); } return bb_dump_dump(dumper, argv); |