aboutsummaryrefslogtreecommitdiff
path: root/util-linux/hexdump_xxd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-25 17:00:38 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-25 17:00:38 +0100
commit7dd906a3884a31458d30fc43eb9885c5adf4bbea (patch)
treefb2abc48a0d8aff2a7147e28241408286c0c337b /util-linux/hexdump_xxd.c
parent62a9b18547462a657ffb18cf03d5cfdcf774c905 (diff)
downloadbusybox-w32-7dd906a3884a31458d30fc43eb9885c5adf4bbea.tar.gz
busybox-w32-7dd906a3884a31458d30fc43eb9885c5adf4bbea.tar.bz2
busybox-w32-7dd906a3884a31458d30fc43eb9885c5adf4bbea.zip
xxd: make -p output lines actually end with a newline
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/hexdump_xxd.c')
-rw-r--r--util-linux/hexdump_xxd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c
index cc34ea649..be4b4f354 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)
129 } 129 }
130 // for -g3, this results in B B BS B B BS... B = "xxxxxx xxxxxx .....xx" 130 // for -g3, this results in B B BS B B BS... B = "xxxxxx xxxxxx .....xx"
131 // todo: can be more clever and use 131 // todo: can be more clever and use
132 // one "cols-1/B" format instead of many "B B B..." formats 132 // one 'bytes-1/1 "%02x"' format instead of many "B B B..." formats
133 //bb_error_msg("ADDED:'%s'", bigbuf); 133 //bb_error_msg("ADDED:'%s'", bigbuf);
134 bb_dump_add(dumper, bigbuf); 134 bb_dump_add(dumper, bigbuf);
135 free(bigbuf); 135 free(bigbuf);
@@ -138,6 +138,8 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
138 if (!(opt & OPT_p)) { 138 if (!(opt & OPT_p)) {
139 sprintf(buf, "\" \"%u/1 \"%%_p\"\"\n\"", cols); // " ASCII\n" 139 sprintf(buf, "\" \"%u/1 \"%%_p\"\"\n\"", cols); // " ASCII\n"
140 bb_dump_add(dumper, buf); 140 bb_dump_add(dumper, buf);
141 } else {
142 bb_dump_add(dumper, "\"\n\"");
141 } 143 }
142 144
143 return bb_dump_dump(dumper, argv); 145 return bb_dump_dump(dumper, argv);