OSDN Git Service

Add xxd -i (and xxd -ri).
authorElliott Hughes <enh@google.com>
Sun, 24 Dec 2017 08:42:38 +0000 (00:42 -0800)
committerRob Landley <rob@landley.net>
Wed, 27 Dec 2017 04:28:10 +0000 (22:28 -0600)
commit215a6af5f83e7866751f24fc61f709b444e61c1d
treec1365d13267256e6fc1877ab3f238b6f5ac0ea32
parent70a6c55499eabf1229dfb0b49f08b366cbaa7896
Add xxd -i (and xxd -ri).

The original xxd doesn't support -r with -i. The original also outputs
"unsigned char name[] = { ... };" for input other than stdin, but that
actually makes it less useful --- many languages support array
initializers, but far fewer support that exact declaration syntax.

Also fix the -c range checking and defaulting: ><= in the argument string
only works for floating point arguments.

Bug: http://b/64711851
tests/xxd.test
toys/other/xxd.c