Home | History | Annotate | only in /src/usr.bin/hexdump
History log of /src/usr.bin/hexdump
RevisionDateAuthorComments
 1.16 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.15 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.14 14-Aug-2011  christos branches: 1.14.42;
document non-literal format strings.
 1.13 14-Apr-2009  lukem Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.12 08-Oct-2006  peter branches: 1.12.26;
WFORMAT is no more...
 1.11 29-Aug-2006  christos protect libutil with hostprog
 1.10 26-Aug-2006  christos More programs using efun.
 1.9 18-May-2003  lukem Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
 1.8 07-Mar-2003  thorpej Make hexdump a host tool.
 1.7 07-Dec-2001  bjh21 WARNS=2
 1.6 11-Oct-2000  is More format string cleanup by sommerfeld.
 1.5 18-Oct-1997  mrg branches: 1.5.4; 1.5.12;
merge lite-2.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 22-Dec-1994  cgd specify man pages the new way.
 1.2 31-Jul-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.1 18-Oct-2000  tv Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
 1.5.4.1 19-Oct-2000  he Pull up revision 1.6 (requested by he):
Format string cleanup.
 1.12.26.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.14.42.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.14 09-Feb-2013  jakllsch "dcl" is not "dc1".

Fixes PR#47547
 1.13 09-Feb-2010  drochner branches: 1.13.6; 1.13.12;
remove agitation that od(1) was deprecated -- it is still POSIX
 1.12 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.11 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.10 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.8 12-Mar-2003  augustss More tests if __RCSID is defined.
 1.7 07-Dec-2001  bjh21 WARNS=2
 1.6 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.5 18-Oct-1997  mrg merge lite-2.
 1.4 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.3 09-Jan-1997  tls RCS ID police
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.12.1 25-Feb-2013  tls resync with head
 1.13.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27 14-Jan-2024  christos better check st_size == 0, than st_dev == -1
 1.26 14-Jan-2024  christos PR/57851: Ricardo Branco: stat(2) does not return correct size information
for kernfs/procfs files. Minor KNF.
 1.25 04-Mar-2016  dholland Don't try to use stdin after clobbering it with a failed freopen().
Prevents an extra "Bad file descriptor" message when trying to hexdump
a single nonexistent file.

The intended behavior seems to have been to read from stdin if there
was one filename given and it wasn't valid. But this seems like a bad
idea, so prevent that case instead of hacking it up so it works.
 1.24 04-Mar-2016  dholland Don't use one function for two different things. Two functions is the
ticket.
 1.23 04-Mar-2016  dholland use "static"
 1.22 18-Oct-2013  christos don't read random garbage from the stack
 1.21 18-Jan-2009  apb branches: 1.21.8; 1.21.14;
Integer values, no matter what their width, are cast to int64_t or
uint64_t for printing. Because of this, parse.c:rewrite() should use
PRI[diouxX]64 as the printf format; the previous revision which used
"lld" and friends was a temporary measure. We assume that PRId64 ends
with 'd', PRIx64 ends with 'x', etc.

In display.c:display(), change some u_intNN_t types to C99 standard
uintNN_t types, and consistently cast to [u]int64_t when printing
integer values (even in two cases where it's not really necessary but it
makes the code look more consistent).
 1.20 26-Aug-2006  christos More programs using efun.
 1.19 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.18 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.17 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.16 12-Sep-2003  cl include <inttypes.h> to get uint64_t defined
 1.15 09-Sep-2003  wiz This is a host tool: use {u,}int64_t instead of {u_,}quad_t.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.13 12-Mar-2003  augustss Two more __RCSID checks that I missed.
 1.12 07-Dec-2001  bjh21 WARNS=2
 1.11 07-Dec-2001  bjh21 Enable support for printing 8-byte integers. For some reason, most of the
code for this was present, but disabled.
This is required for POSIX compliance on platforms with 8-byte longs.
 1.10 15-Feb-2001  christos PR/9195: Tanaka Akira: od does not display short files containing nulls. Fix
from Andrew Brown.
 1.9 10-Jul-2000  itojun printf() pedant - even if we are sure that there's no %-formatted in a
varaiable, don't pass variable alone to printf().
From: kris@freebsd.org (FreeBSD-current usr.bin/hexdump/display.c 1.4 -> 1.6)
 1.8 09-Nov-1999  drochner branches: 1.8.4;
Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
 1.7 19-Oct-1997  lukem branches: 1.7.8;
WARNSify, fix .Nm usage, deprecate register
 1.6 18-Oct-1997  mrg merge lite-2.
 1.5 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 07-May-1996  jtc Include appropriate header files to bring prototypes into scope.
Removed explicit errno declarations.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 28-Jul-2000  itojun pullup (approved by releng-1-5)
printf-like format pedant. do not pass string variable alone. use "%s".
from openbsd.

/cvsroot/basesrc/usr.bin/biff/biff.c 1.6 -> 1.7
/cvsroot/basesrc/usr.bin/chpass/chpass.c 1.18 -> 1.19
/cvsroot/basesrc/usr.bin/finger/net.c 1.13 -> 1.14
/cvsroot/basesrc/usr.bin/finger/util.c 1.15 -> 1.16
/cvsroot/basesrc/usr.bin/hexdump/display.c 1.8 -> 1.9
/cvsroot/basesrc/usr.bin/ktrace/ktrace.c 1.18 -> 1.19
/cvsroot/basesrc/usr.bin/mail/lex.c 1.14 -> 1.15
/cvsroot/basesrc/usr.bin/modstat/modstat.c 1.14 -> 1.15
/cvsroot/basesrc/usr.bin/tcopy/tcopy.c 1.9 -> 1.10
/cvsroot/basesrc/usr.bin/tn3270/ascii/map3270.c 1.7 -> 1.8
/cvsroot/basesrc/usr.bin/tn3270/tools/mkmake/mkmake.y 1.7 -> 1.8
/cvsroot/basesrc/usr.bin/vmstat/dkstats.c 1.8 -> 1.9
 1.21.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24 06-Jul-2012  wiz Bug Hunting:
improve wording
 1.23 06-Jul-2012  wiz From Bug Hunting:
- sort options in `SYNOPSIS' and `DESCRIPTION' sections;
- correct / improve macro usage;
- synchronize argument name to `-s' option;
- improve punctuation / wording;
- augment `SEE ALSO' section;
- bump date.

While here:
Use Sq for single characters instead of Dq.
Use Aq instead of \*[Lt]...\*[Gt].
Mark up NULL with Dv.
 1.22 08-Apr-2012  wiz Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.21 18-Dec-2010  wiz branches: 1.21.6;
Replace "\t" with Ta in table.
Fixes output with mandoc. Noted by njoly.
 1.20 27-Feb-2010  mbalmer DEL is 0x7F, not 0xFF. From FreeBSD via OpenBSD.
 1.19 14-Oct-2009  joerg Do not use .Xo/.Xc to workaround ancient groff limits.
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.17 30-Jun-2003  wiz Fixes to make these man page look nice with groff-1.19.
 1.16 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.15 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.14 07-Dec-2001  bjh21 Mention that eight-byte integers work.
 1.13 07-Dec-2001  bjh21 POSIX.2 doesn't specify hexdump, so we can't claim our hexdump is compatible
with it.
 1.12 01-Dec-2001  wiz Whitespace cleanup.
 1.11 06-May-2001  wiz Improve usage of `comprise' according to Webster and misc/10893
by Jim Bernard.
 1.10 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.9 20-Feb-1998  jeremy Added -C option for hexadecimal+ASCII display. [PR/5017]
Fixed minor inconsistency in option descriptions in the man page.
 1.8 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.7 18-Oct-1997  mrg merge lite-2.
 1.6 10-Jul-1997  mikel kill xref to nonexistent adb(1)
 1.5 09-Jan-1997  tls RCS ID police
 1.4 11-Nov-1996  lukem fix the the typos
 1.3 11-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 18-Apr-1994  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.21.6.2 30-Oct-2012  yamt sync with head
 1.21.6.1 17-Apr-2012  yamt sync with head
 1.19 04-Mar-2016  dholland Don't use one function for two different things. Two functions is the
ticket.
 1.18 06-Jul-2012  wiz From Bug Hunting:
- de-capitalize ``usage'' in `usage' message;
- synchronize `usage' message with man pages.
 1.17 28-Nov-2010  mrg branches: 1.17.6;
properly detect that we aren't od(1) and act as hexdump. fixes hexdump,
which also broke startx (second time this week!)

from mlelstv.
 1.16 27-Nov-2010  christos revert and fix the usage to be consistent with other programs.
 1.15 09-Feb-2010  drochner remove agitation that od(1) was deprecated -- it is still POSIX
 1.14 21-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.13 04-Jan-2006  perry branches: 1.13.22;
de-__P, ANSIfy prototypes
 1.12 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.11 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.9 12-Mar-2003  augustss Do the defined(__RCSID) song and dance to enable cross compilation.
 1.8 12-Nov-2002  kleink setlocale(LC_ALL, "") on startup.
 1.7 19-Oct-1997  lukem branches: 1.7.14;
WARNSify, fix .Nm usage, deprecate register
 1.6 18-Oct-1997  mrg merge lite-2.
 1.5 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 07-May-1996  jtc Include appropriate header files to bring prototypes into scope.
Removed explicit errno declarations.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.14.1 11-Dec-2002  he Pull up revision 1.8 (requested by kleink in ticket #985):
Do setlocale(LC_ALL, "") on startup.
 1.13.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.6.1 30-Oct-2012  yamt sync with head
 1.15 04-Mar-2016  dholland Don't use one function for two different things. Two functions is the
ticket.
 1.14 04-Mar-2016  dholland use "static"
 1.13 04-Sep-2011  joerg static + __dead
 1.12 27-Nov-2010  christos revert and fix the usage to be consistent with other programs.
 1.11 09-Feb-2010  drochner remove agitation that od(1) was deprecated -- it is still POSIX
 1.10 26-Aug-2006  christos More programs using efun.
 1.9 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.7 07-Dec-2001  bjh21 WARNS=2
 1.6 07-Feb-2001  christos constify
 1.5 18-Oct-1997  mrg merge lite-2.
 1.4 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.3 09-Jan-1997  tls RCS ID police
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.14 27-Nov-2010  christos revert and fix the usage to be consistent with other programs.
 1.13 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.12 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.11 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.9 12-Mar-2003  augustss Two more __RCSID checks that I missed.
 1.8 08-Apr-1998  jeremy Show -C option in usage. PR/5266
 1.7 20-Feb-1998  jeremy Added -C option for hexadecimal+ASCII display. [PR/5017]
Fixed minor inconsistency in option descriptions in the man page.
 1.6 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.5 18-Oct-1997  mrg merge lite-2.
 1.4 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.3 09-Jan-1997  tls RCS ID police
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 04-May-1995  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.27 06-Jul-2012  wiz From Bug Hunting:
- correct / improve macro usage;
- (re-)add an actual description in `DESCRIPTION' section;
- synchronize argument name to `-j' option;
- improve wording;
- bump date.
 1.26 08-Apr-2012  wiz Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
 1.25 09-Feb-2010  wiz branches: 1.25.6;
Bump date for previous.
 1.24 09-Feb-2010  drochner remove agitation that od(1) was deprecated -- it is still POSIX
 1.23 03-Sep-2008  drochner Support -the "-A addressformat" flag for od(1), from FreeBSD.
(I found a script which tries to figure out the byteorder of a box
by "od -An | grep", but it is POSIX anyway.)
There is a little behavioural change: The whitespace without any arguments
is like "-to2" now; before it was custom. It's not worse imho.
 1.22 30-Apr-2008  martin branches: 1.22.2;
Convert TNF licenses to new 2 clause variant
 1.21 25-Feb-2003  wiz branches: 1.21.32;
.Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.20 12-Jan-2003  mjl Correct typos (from OpenBSD).
 1.19 06-Jan-2003  wiz Wrong word; from jmc@prioris.mini.pw.edu.pl via openbsd.
 1.18 30-Sep-2002  grant New sentence, new line.
 1.17 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.16 07-Dec-2001  bjh21 Further POSIX progress: The C, S, I and L modifiers now behave correctly,
specifying output in units of a char, short, int and long (as defined by the
host system) respectively. This made the POSIX -t code more than complicated
enough to merit its own function, so I did that.
 1.15 05-Dec-2001  bjh21 Further POSIXification: od now supports -N, which is equivalent to hexdump's
-n (format only COUNT bytes of input).
 1.14 05-Dec-2001  bjh21 Add a -j option to od, which does the same as the -s option to
hexdump (skipping some of the input). This brings our od slightly
closer to POSIX.2 conformance.
 1.13 03-Oct-2001  atatat Hmm...apparently I left out a word.
 1.12 04-Apr-2001  wiz Lowercase name in xref.
 1.11 10-Feb-2001  christos fix fix typo from @@@
 1.10 09-Feb-2001  christos new man page from @@@
 1.9 07-Feb-2001  christos PR/12147: TheMan: add -t option to od.
 1.8 07-Mar-1999  mycroft Clean up SYNOPSIS formatting.
 1.7 06-Mar-1999  mycroft Add a real date.
 1.6 08-Jun-1998  lukem everything has bugs; either document them or don't bother with a BUGS section
 1.5 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.4 18-Oct-1997  mrg merge lite-2.
 1.3 09-Jan-1997  tls RCS ID police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Dec-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.21.32.1 18-May-2008  yamt sync with head.
 1.22.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.25.6.2 30-Oct-2012  yamt sync with head
 1.25.6.1 17-Apr-2012  yamt sync with head
 1.28 27-Nov-2010  christos revert and fix the usage to be consistent with other programs.
 1.27 27-Nov-2010  dholland PR 44156: od -? prints usage for "hexdump" rather than "od"
 1.26 09-Feb-2010  drochner remove agitation that od(1) was deprecated -- it is still POSIX
 1.25 03-Sep-2008  drochner Support -the "-A addressformat" flag for od(1), from FreeBSD.
(I found a script which tries to figure out the byteorder of a box
by "od -An | grep", but it is POSIX anyway.)
There is a little behavioural change: The whitespace without any arguments
is like "-to2" now; before it was custom. It's not worse imho.
 1.24 26-Aug-2006  christos branches: 1.24.18;
More programs using efun.
 1.23 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.22 02-Jun-2005  lukem appease gcc -Wuninitialized
 1.21 30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.20 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.19 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.17 12-Mar-2003  augustss More tests if __RCSID is defined.
 1.16 30-Mar-2002  bjh21 More POSIX overhaul:
Support the F, D and L modifiers to the f format correctly.
Generate hexdump byte-counts, precisions and spacings automatically.
 1.15 07-Dec-2001  bjh21 WARNS=2
 1.14 07-Dec-2001  bjh21 Further POSIX progress: The C, S, I and L modifiers now behave correctly,
specifying output in units of a char, short, int and long (as defined by the
host system) respectively. This made the POSIX -t code more than complicated
enough to merit its own function, so I did that.
 1.13 05-Dec-2001  bjh21 Further POSIXification: od now supports -N, which is equivalent to hexdump's
-n (format only COUNT bytes of input).
 1.12 05-Dec-2001  bjh21 Add a -j option to od, which does the same as the -s option to
hexdump (skipping some of the input). This brings our od slightly
closer to POSIX.2 conformance.
 1.11 07-Feb-2001  christos PR/12147: TheMan: add -t option to od.
 1.10 19-Dec-1998  christos char -> unsigned char
 1.9 25-Aug-1998  ross Add { and } to shut up egcs. Reformat the more questionable code.
 1.8 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.7 18-Oct-1997  mrg merge lite-2.
 1.6 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.5 09-Jan-1997  tls RCS ID police
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 04-May-1993  mycroft Previous patch was incorrect.
 1.2 03-May-1993  sef Fix a NULL-dereferencing, that caused a segfault with QMAGIC (yay).
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 04-May-1995  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.24.18.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.27 04-Sep-2011  joerg static + __dead
 1.26 18-Jan-2009  apb Integer values, no matter what their width, are cast to int64_t or
uint64_t for printing. Because of this, parse.c:rewrite() should use
PRI[diouxX]64 as the printf format; the previous revision which used
"lld" and friends was a temporary measure. We assume that PRId64 ends
with 'd', PRIx64 ends with 'x', etc.

In display.c:display(), change some u_intNN_t types to C99 standard
uintNN_t types, and consistently cast to [u]int64_t when printing
integer values (even in two cases where it's not really necessary but it
makes the code look more consistent).
 1.25 17-Jan-2009  hans Use ll instead of non-standard q as length modifier in format strings.
Makes this work on Solaris. OK by apb.
 1.24 09-Oct-2006  christos branches: 1.24.24;
use ecalloc in previous
 1.23 09-Oct-2006  dsl Fix core dump caused by non-zerod memory.
From Auster in current_users.
 1.22 23-Sep-2006  elad PR/28157: KAMADA Ken'ichi: escape sequence of hexdump(1) is broken
(SIGSEGV at worst)
Applied patch, thanks for the report!
 1.21 05-Sep-2006  hira Fix uninitialized variables.
 1.20 26-Aug-2006  christos More programs using efun.
 1.19 30-Mar-2006  dsl Simplify the way the end of a singly linked list is followed (for adding
items) so it is more obvious that we aren't going to indirect through
a null pointer.
Fixes coverty SID:101
 1.18 04-Jan-2006  perry de-__P, ANSIfy prototypes
 1.17 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.16 22-Oct-2003  dmcmahill add
#if HAVE_CONFIG_H
#include "config.h"
#endif
to get this to build under solaris-2.6/sparc with gcc-2.95.1 as part of
the NetBSD cross toolchain build. Fixes PR23211. Patch approved by
Alistair Crooks.
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.14 12-Mar-2003  augustss More tests if __RCSID is defined.
 1.13 11-Jun-2002  itojun err/errx/warn/warnx do not need \n at the end
 1.12 07-Dec-2001  bjh21 Enable support for printing 8-byte integers. For some reason, most of the
code for this was present, but disabled.
This is required for POSIX compliance on platforms with 8-byte longs.
 1.11 07-Feb-2001  christos constify
 1.10 14-Oct-2000  bjh21 Don't core dump with an empty format string. Fixes PR#11218.
Patch supplied by Launey Thomas.
 1.9 11-Oct-2000  itojun string length computation bug. PR 8676.
 1.8 19-Dec-1998  christos branches: 1.8.2; 1.8.10;
char -> unsigned char
 1.7 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.6 18-Oct-1997  mrg merge lite-2.
 1.5 11-Jul-1997  mikel add explicit return types to many functions
pull global variable declarations and function prototypes into hexdump.h
add #includes where necessary for prototypes
replace index() with strchr(), const-poison static string vars, etc.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 20-May-1994  pk Display addresses -- which are off_t's -- with proper format string.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 06-Jun-1993  mrg 4.4BSD-Lite2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.10.2 17-Oct-2000  tv Pullup 1.9 [itojun]:
string length computation bug. PR 8676.
 1.8.10.1 17-Oct-2000  tv Pullup 1.10 [bjh21]:
Don't core dump with an empty format string. Fixes PR#11218.
Patch supplied by Launey Thomas.
 1.8.2.1 12-Oct-2000  he Pull up revision 1.9 (requested by itojun):
Fix string length computation bug. Fixes PR#8676.
 1.24.24.1 27-Mar-2009  msaitoh Pull up following revision(s) (requested by sketch in ticket #536):
etc/Makefile: revision 1.364
Makefile: revision 1.267
usr.sbin/postinstall/postinstall: revision 1.90
usr.bin/hexdump/parse.c: revision 1.25
sys/arch/x86/acpi/genwakecode.sh: revision 1.3
usr.sbin/postinstall/postinstall: revision 1.87
usr.sbin/postinstall/postinstall: revision 1.88
usr.sbin/postinstall/postinstall: revision 1.89
sys/arch/x86/acpi/Makefile.wakecode.inc: revision 1.4
sys/conf/Makefile.kern.inc: revision 1.120
Use ll instead of non-standard q as length modifier in format strings. Makes
this work on Solaris. OK by apb.
Not every grep knows -q. Ok by apb.
Use sed, awk and hexdump from tools to make this work on Solaris. Ok by apb.
Use awk and grep host tools where required. 'build.sh release' now
works on Solaris (but only with HOST_CC=/usr/sfw/bin/gcc for now).
"grep -q" is not portable; use "grep >/dev/null" instead. Also add a
comment saying that postinstal is invoked during a cross build.
In file_exists_exact(), fix an incorrect test of "1" instead of "$1",
and improve the comment explaining what this function does.
As long as we don't yet have a working TOOL_GREP, fgrep is more portablethan grep -F.

RSS XML Feed