od, hexdump: byte 0x11 is "dc1" not "dcl"
No binary (build failed)
—
(log yok)
| @@ -516,10 +516,12 @@ static void conv_u(PR *pr, unsigned char *p) | |
| static const char list[] ALIGN1 = | |
| "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" | |
| "bs\0_ht\0_lf\0_vt\0_ff\0_cr\0_so\0_si\0_" | |
| - | "dle\0dcl\0dc2\0dc3\0dc4\0nak\0syn\0etb\0" |
| + | "dle\0dc1\0dc2\0dc3\0dc4\0nak\0syn\0etb\0" |
| "can\0em\0_sub\0esc\0fs\0_gs\0_rs\0_us"; | |
| + | /* NB: bug: od uses %_u to implement -a, |
| + | * but it should use "nl", not "lf", for char #10. |
| + | */ |
| - | /* od used nl, not lf */ |
| if (*p <= 0x1f) { | |
| *pr->cchar = 's'; | |
| printf(pr->fmt, list + (4 * (int)*p)); | |
| @@ -34,4 +34,20 @@ testing "hexdump thinks last full block can match" \ | |
| '' \ | |
| '\0\0\0\0\0\0\0\0\0\0\0\0' | |
| + | testing "hexdump e %3_u" \ |
| + | "hexdump -e '16/1 \" %3_u\" \"\n\"'" \ |
| + | "\ |
| + | nul soh stx etx eot enq ack bel bs ht lf vt ff cr so si |
| + | dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us |
| + | p q r s t u v w x y z { | } ~ del |
| + | 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f |
| + | f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff |
| + | " \ |
| + | "" \ |
| + | "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"\ |
| + | "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"\ |
| + | "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"\ |
| + | "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ |
| + | "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\ |
| + | |
| exit $FAILCOUNT | |
| @@ -26,21 +26,39 @@ optional !DESKTOP | |
| testing "od -a (!DESKTOP)" \ | |
| "od -a" \ | |
| "\ | |
| - | 0000000 soh stx etx lf A B C fe |
| - | 0000010 |
| + | 0000000 nul soh stx etx eot enq ack bel bs ht lf vt ff cr so si |
| + | 0000020 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us |
| + | 0000040 p q r s t u v w x y z { | } ~ del |
| + | 0000060 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f |
| + | 0000100 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff |
| + | 0000120 |
| " \ | |
| - | "" "$input" |
| + | "" \ |
| + | "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"\ |
| + | "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"\ |
| + | "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"\ |
| + | "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ |
| + | "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" |
| SKIP= | |
| - | # ^^^ a bit incorrect handling of ctrl/high bytes. |
| + | # ^^^ a bit incorrect handling of ctrl ("lf" should be "nl") and high bytes. |
| # vvv this output is correct. | |
| optional DESKTOP | |
| testing "od -a (DESKTOP)" \ | |
| "od -a" \ | |
| "\ | |
| - | 0000000 soh stx etx nl A B C ~ |
| - | 0000010 |
| + | 0000000 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si |
| + | 0000020 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us |
| + | 0000040 p q r s t u v w x y z { | } ~ del |
| + | 0000060 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si |
| + | 0000100 p q r s t u v w x y z { | } ~ del |
| + | 0000120 |
| " \ | |
| - | "" "$input" |
| + | "" \ |
| + | "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"\ |
| + | "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"\ |
| + | "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"\ |
| + | "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ |
| + | "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" |
| SKIP= | |
| testing "od -B" \ | |