Home | History | Annotate | Download | only in hexdump
History log of /src/usr.bin/hexdump/display.c
RevisionDateAuthorComments
 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")

RSS XML Feed