hexdump: deindent, almost fits into 80 columns now

This commit is contained in:
Denis Vlasenko 2006-09-23 13:31:46 +00:00
parent a36a676923
commit 2dbeaa95ca

View File

@ -53,7 +53,6 @@ static const struct suffix_mult suffixes[] = {
int hexdump_main(int argc, char **argv) int hexdump_main(int argc, char **argv)
{ {
// register FS *tfs;
const char *p; const char *p;
int ch; int ch;
@ -61,7 +60,9 @@ int hexdump_main(int argc, char **argv)
bb_dump_length = -1; bb_dump_length = -1;
while ((ch = getopt(argc, argv, hexdump_opts)) > 0) { while ((ch = getopt(argc, argv, hexdump_opts)) > 0) {
if ((p = strchr(hexdump_opts, ch)) != NULL) { p = strchr(hexdump_opts, ch)
if (!p)
bb_show_usage();
if ((p - hexdump_opts) < 5) { if ((p - hexdump_opts) < 5) {
bb_dump_add(add_first); bb_dump_add(add_first);
bb_dump_add(add_strings[(int)(p - hexdump_opts)]); bb_dump_add(add_strings[(int)(p - hexdump_opts)]);
@ -70,7 +71,7 @@ int hexdump_main(int argc, char **argv)
bb_dump_add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" "); bb_dump_add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" ");
bb_dump_add("\" |\" 16/1 \"%_p\" \"|\\n\""); bb_dump_add("\" |\" 16/1 \"%_p\" \"|\\n\"");
} else { } else {
/* Sae a little bit of space below by omitting the 'else's. */ /* Save a little bit of space below by omitting the 'else's. */
if (ch == 'e') { if (ch == 'e') {
bb_dump_add(optarg); bb_dump_add(optarg);
} /* else */ } /* else */
@ -87,9 +88,6 @@ int hexdump_main(int argc, char **argv)
bb_dump_vflag = ALL; bb_dump_vflag = ALL;
} }
} }
} else {
bb_show_usage();
}
} }
if (!bb_dump_fshead) { if (!bb_dump_fshead) {
@ -99,5 +97,5 @@ int hexdump_main(int argc, char **argv)
argv += optind; argv += optind;
return(bb_dump_dump(argv)); return bb_dump_dump(argv);
} }