xxd: new applet

Yet Another Hexdumper

function                                             old     new   delta
xxd_main                                               -     364    +364
packed_usage                                       31046   31116     +70
applet_names                                        2560    2564      +4
applet_main                                         1476    1480      +4
rewrite                                             1022    1013      -9
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 442/-9)            Total: 433 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-01-25 01:58:00 +01:00
parent 2181fb4af8
commit 0f4364775f
3 changed files with 149 additions and 16 deletions

View File

@ -165,16 +165,14 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
byte_count_str = "\001";
DO_BYTE_COUNT:
if (fu->bcnt) {
do {
if (fu->bcnt == *byte_count_str) {
for (;;) {
if (fu->bcnt == *byte_count_str)
break;
}
} while (*++byte_count_str);
if (*++byte_count_str == 0)
bb_error_msg_and_die("bad byte count for conversion character %s", p1);
}
}
/* Unlike the original, output the remainder of the format string. */
if (!*byte_count_str) {
bb_error_msg_and_die("bad byte count for conversion character %s", p1);
}
pr->bcnt = *byte_count_str;
} else if (*p1 == 'l') {
++p2;