Module Name: src Committed By: drochner Date: Tue Feb 9 14:06:37 UTC 2010
Modified Files: src/usr.bin/hexdump: conv.c hexdump.c hexdump.h od.1 odsyntax.c Log Message: remove agitation that od(1) was deprecated -- it is still POSIX To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.bin/hexdump/conv.c cvs rdiff -u -r1.14 -r1.15 src/usr.bin/hexdump/hexdump.c cvs rdiff -u -r1.10 -r1.11 src/usr.bin/hexdump/hexdump.h cvs rdiff -u -r1.23 -r1.24 src/usr.bin/hexdump/od.1 cvs rdiff -u -r1.25 -r1.26 src/usr.bin/hexdump/odsyntax.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/hexdump/conv.c diff -u src/usr.bin/hexdump/conv.c:1.12 src/usr.bin/hexdump/conv.c:1.13 --- src/usr.bin/hexdump/conv.c:1.12 Wed Jan 4 01:30:21 2006 +++ src/usr.bin/hexdump/conv.c Tue Feb 9 14:06:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: conv.c,v 1.12 2006/01/04 01:30:21 perry Exp $ */ +/* $NetBSD: conv.c,v 1.13 2010/02/09 14:06:37 drochner Exp $ */ /* * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)conv.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: conv.c,v 1.12 2006/01/04 01:30:21 perry Exp $"); +__RCSID("$NetBSD: conv.c,v 1.13 2010/02/09 14:06:37 drochner Exp $"); #endif #endif /* not lint */ @@ -61,7 +61,7 @@ goto strpr; /* case '\a': */ case '\007': - if (deprecated) /* od didn't know about \a */ + if (odmode) /* od doesn't know about \a */ break; str = "\\a"; goto strpr; @@ -81,7 +81,7 @@ str = "\\t"; goto strpr; case '\v': - if (deprecated) + if (odmode) break; str = "\\v"; goto strpr; @@ -112,14 +112,14 @@ /* od used nl, not lf */ if (*p <= 0x1f) { *pr->cchar = 's'; - if (deprecated && *p == 0x0a) + if (odmode && *p == 0x0a) (void)printf(pr->fmt, "nl"); else (void)printf(pr->fmt, list[*p]); } else if (*p == 0x7f) { *pr->cchar = 's'; (void)printf(pr->fmt, "del"); - } else if (deprecated && *p == 0x20) { /* od replaced space with sp */ + } else if (odmode && *p == 0x20) { /* od replaces space with sp */ *pr->cchar = 's'; (void)printf(pr->fmt, " sp"); } else if (isprint(*p)) { Index: src/usr.bin/hexdump/hexdump.c diff -u src/usr.bin/hexdump/hexdump.c:1.14 src/usr.bin/hexdump/hexdump.c:1.15 --- src/usr.bin/hexdump/hexdump.c:1.14 Mon Jul 21 14:19:23 2008 +++ src/usr.bin/hexdump/hexdump.c Tue Feb 9 14:06:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: hexdump.c,v 1.14 2008/07/21 14:19:23 lukem Exp $ */ +/* $NetBSD: hexdump.c,v 1.15 2010/02/09 14:06:37 drochner Exp $ */ /* * Copyright (c) 1989, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)hexdump.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: hexdump.c,v 1.14 2008/07/21 14:19:23 lukem Exp $"); +__RCSID("$NetBSD: hexdump.c,v 1.15 2010/02/09 14:06:37 drochner Exp $"); #endif #endif /* not lint */ @@ -72,7 +72,7 @@ if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) newsyntax(argc, &argv); else - oldsyntax(argc, &argv); + odsyntax(argc, &argv); /* figure out the data block size */ for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) { Index: src/usr.bin/hexdump/hexdump.h diff -u src/usr.bin/hexdump/hexdump.h:1.10 src/usr.bin/hexdump/hexdump.h:1.11 --- src/usr.bin/hexdump/hexdump.h:1.10 Sat Aug 26 18:17:42 2006 +++ src/usr.bin/hexdump/hexdump.h Tue Feb 9 14:06:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: hexdump.h,v 1.10 2006/08/26 18:17:42 christos Exp $ */ +/* $NetBSD: hexdump.h,v 1.11 2010/02/09 14:06:37 drochner Exp $ */ /* * Copyright (c) 1989, 1993 @@ -71,7 +71,7 @@ enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */ extern int blocksize; /* data block size */ -extern int deprecated; /* od compatibility */ +extern int odmode; /* od compatibility */ extern FU *endfu; /* format at end-of-data */ extern int exitval; /* final exit value */ extern FS *fshead; /* head of format strings list */ @@ -95,7 +95,7 @@ u_char *get(void); void newsyntax(int, char ***); int next(char **); -void oldsyntax(int, char ***); +void odsyntax(int, char ***); void rewrite(FS *); int size(FS *); void usage(void); Index: src/usr.bin/hexdump/od.1 diff -u src/usr.bin/hexdump/od.1:1.23 src/usr.bin/hexdump/od.1:1.24 --- src/usr.bin/hexdump/od.1:1.23 Wed Sep 3 16:32:57 2008 +++ src/usr.bin/hexdump/od.1 Tue Feb 9 14:06:37 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: od.1,v 1.23 2008/09/03 16:32:57 drochner Exp $ +.\" $NetBSD: od.1,v 1.24 2010/02/09 14:06:37 drochner Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -56,26 +56,6 @@ .Oc .Ar file ... .Sh DESCRIPTION -.Nm -has been deprecated in favor of -.Xr hexdump 1 . -.Pp -.Xr hexdump 1 , -if called as -.Nm , -provides compatibility for the options described below. -It does not provide compatibility for the -.Fl s -option (see -.Xr strings 1 ) -or the -.Fl P , -.Fl p , -or -.Fl w -options, nor is compatibility provided for the ``label'' component -of the offset syntax. -.Pp The options are as follows: .Bl -tag -width Fl .It Fl A Ar base Index: src/usr.bin/hexdump/odsyntax.c diff -u src/usr.bin/hexdump/odsyntax.c:1.25 src/usr.bin/hexdump/odsyntax.c:1.26 --- src/usr.bin/hexdump/odsyntax.c:1.25 Wed Sep 3 16:32:57 2008 +++ src/usr.bin/hexdump/odsyntax.c Tue Feb 9 14:06:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: odsyntax.c,v 1.25 2008/09/03 16:32:57 drochner Exp $ */ +/* $NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner 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.25 2008/09/03 16:32:57 drochner Exp $"); +__RCSID("$NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $"); #endif #endif /* not lint */ @@ -68,13 +68,13 @@ char const *format2; }; -int deprecated; +int odmode; static void odoffset(int, char ***); static void posixtypes(char const *); void -oldsyntax(int argc, char ***argvp) +odsyntax(int argc, char ***argvp) { static char empty[] = "", padding[] = PADDING; int ch; @@ -84,10 +84,10 @@ add("\"%07.7_Ao\n\""); add("\"%07.7_ao \""); - deprecated = 1; + odmode = 1; argv = *argvp; while ((ch = getopt(argc, argv, - "A:aBbcDdeFfHhIij:LlN:OoPpst:wvXx")) != -1) + "A:aBbcDdeFfHhIij:LlN:Oot:vXx")) != -1) switch (ch) { case 'A': switch (*optarg) { @@ -174,17 +174,8 @@ case 'v': vflag = ALL; break; - case 'P': - case 'p': - case 's': - case 'w': case '?': default: - warnx("od(1) has been deprecated for hexdump(1)."); - if (ch != '?') - warnx( -"hexdump(1) compatibility doesn't support the -%c option%s\n", - ch, ch == 's' ? "; see strings(1)." : "."); usage(); }