Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/hexdump PR 44156: od -? prints usage for "hexdump" r...
details: https://anonhg.NetBSD.org/src/rev/550c38623ef2
branches: trunk
changeset: 759057:550c38623ef2
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Nov 27 00:42:58 2010 +0000
description:
PR 44156: od -? prints usage for "hexdump" rather than "od"
diffstat:
usr.bin/hexdump/odsyntax.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diffs (75 lines):
diff -r bab472d57895 -r 550c38623ef2 usr.bin/hexdump/odsyntax.c
--- a/usr.bin/hexdump/odsyntax.c Fri Nov 26 22:01:53 2010 +0000
+++ b/usr.bin/hexdump/odsyntax.c Sat Nov 27 00:42:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $ */
+/* $NetBSD: odsyntax.c,v 1.27 2010/11/27 00:42:58 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)odsyntax.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $");
+__RCSID("$NetBSD: odsyntax.c,v 1.27 2010/11/27 00:42:58 dholland Exp $");
#endif
#endif /* not lint */
@@ -72,6 +72,7 @@
static void odoffset(int, char ***);
static void posixtypes(char const *);
+static void odusage(void);
void
odsyntax(int argc, char ***argvp)
@@ -176,7 +177,7 @@
break;
case '?':
default:
- usage();
+ odusage();
}
if (fshead->nextfs->nextfs == NULL)
@@ -246,7 +247,7 @@
default:
warnx("Bad type-size qualifier '%c'",
*type_string);
- usage();
+ odusage();
}
type_string++;
} else if (isdigit((unsigned char)*type_string)) {
@@ -276,7 +277,7 @@
default:
warnx("Bad type-size qualifier '%c'",
*type_string);
- usage();
+ odusage();
}
type_string++;
} else if (isdigit((unsigned char)*type_string)) {
@@ -286,7 +287,7 @@
nbytes = 4;
break;
default:
- usage();
+ odusage();
}
for (odf = odftab; odf->type != 0; odf++)
if (odf->type == type && odf->nbytes == nbytes)
@@ -396,3 +397,12 @@
/* Terminate file list. */
(*argvp)[1] = NULL;
}
+
+static void
+odusage(void)
+{
+ (void)warnx("Usage: od [-aBbcDdeFfHhIiLlOovXx] [-A base] [-j skip]"
+ " [-N length]");
+ (void)warnx(" [-t type_string] [[+]offset[.][Bb]] [file ...]");
+ exit(1);
+}
Home |
Main Index |
Thread Index |
Old Index