Commit Graph

123 Commits

Author SHA1 Message Date
ed
9b380e30d4 Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
delphij
0842b7d53f Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
delphij
b963db4652 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
delphij
08ae7d200e Use strlcpy() instead of explicitly set \0 on the tail of the array. 2009-06-23 23:32:24 +00:00
ru
aa4e867828 Document the -d option. 2006-12-24 14:23:35 +00:00
ru
e806adde15 Fix markup. 2006-12-24 13:58:17 +00:00
maxim
cf6dea33f2 o Simple strcpy/strcat replacement.
PR:		bin/101575
Founded by:	Dan Lukes
Obtained from:	OpenBSD, rev. 1.11 by deraadt
MFC after:	2 weeks
2006-08-09 19:12:10 +00:00
jkoshy
c03b5b6d66 In 'od -c' mode, deal with printable but zero-width combining
characters correctly.  These characters are displayed "combined"
with a space character.

PR:		misc/100215
Submitted by:	"J.R. Oldroyd" <<fbsd AT opal.com>>
Reviewed by:	"J.R. Oldroyd" <<fbsd AT opal.com>> (revised patch)
MFC after:	3 days
2006-07-31 14:17:04 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ru
169f1013f0 Scheduled mdoc(7) sweep. 2005-01-11 10:32:52 +00:00
tjr
77692f94c6 In next(), ensure that 'done' is set in the case when a file cannot
be opened, to avoid trying to read standard input after already closing
it, which resulted in EBADF errors.
2004-08-04 02:47:32 +00:00
kan
aa7daeefe5 Do not predeclare __inline functions, this makes no sense and generates
a warning with gcc 3.4.x.
2004-07-28 07:10:03 +00:00
johan
f895222e81 display.c:
- 'savech' is only used if it is set a few lines above where
	  it is used, initialize it to silence warning.

	- 'length' is either -1 or greater than 0, hence it is safe to cast it
	  to unsigned when comparing it here.

odsyntax.c:
	- 'p' is assigned either (*argvp)[0] or (*argvp)[1] which both are
	  char *. 'num' and 'end' are assigned values based on 'p'.
	  Hence use char * instead of unsigned char * for these variables.

	  '&end' as the second argument to strtoll does not need to be casted
	  to char** any more.

	  This solves a
	  'dereferencing type-punned pointer will break strict-aliasing rules'
	  warning when compiling with -O2.

parse.c:
	- 'prec' is only used when sokay == USEPREC and sokay = USEPREC
	  when 'prec' is assigned. Hence 'prec' is not used uninitialized,
	  initialize it to silence warning.

	- The code involving 'nextpr' is hard to follow, but I belive
	  'nextpr' will not be used unless it is initialized.
	  Anyway, IF 'nextpr' is used uninitialized it is better to
	  get a consistant error (seg fault, when dereferencing a NULL pointer)
	  than potentially accessing some random memory.

The above changes makes hexdump WARNS=6 clean even when compiled with
-O2. Hence bump WARNS to keep it clean.

Tested by:	CFLAGS='-O2 -pipe' make universe
2004-07-22 13:14:42 +00:00
johan
2eb7ae1cf0 Revert WARNS bump until I figure out why this does not work. 2004-07-17 20:10:23 +00:00
johan
bc489758c0 Include <string.h> to get memset and strcmp prototype.
Sort includes.

This is now WARNS=2 clean, bump WARNS to keep it clean.
2004-07-16 11:07:07 +00:00
tjr
62e0e10696 Add POSIX-style support for multibyte characters to od(1): the 'c'
conversion interprets input bytes as multibyte sequences and displays
printable characters in the area corresponding to their first byte.
The remaining bytes are shown as "**".
2004-07-11 01:11:12 +00:00
tjr
72e8ff2c10 Add a reference to od(1). 2004-07-10 13:11:00 +00:00
tjr
c9e47db057 Document missing multibyte character support in utilities specified
by POSIX.
2004-07-03 01:28:21 +00:00
ru
fb1d8b3724 Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
ru
4b97577172 Capitalize ASCII code names.
Approved by:	re
2002-12-05 08:50:00 +00:00
dwmalone
b4339b74ad ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
markm
31fbc209c3 s/inline/__inline/ 2002-07-19 14:12:27 +00:00
obrien
bc61fc95d8 Consistently use FBSDID 2002-06-30 05:25:07 +00:00
ru
3e4fa1a599 mdoc(7) police: tidy up the markup. 2002-05-29 18:49:22 +00:00
tjr
ec252a0e8b From NetBSD:
Revision 1.10 Sat Oct 14 17:41:55 2000 UTC by bjh21
    Don't core dump with an empty format string.  Fixes PR#11218.
    Patch supplied by Launey Thomas.

Obtained from:	NetBSD
2002-05-27 03:17:28 +00:00
tjr
5a5d149d29 Make the output tidier when multiple integer formats are requested by
attempting to line up values into columns.

Obtained from:	NetBSD (idea)
2002-05-17 08:54:32 +00:00
tjr
98e1f63634 Overhaul hexdump's od syntax code to handle the -s -A -j -N -t options that
SUSv3 requires and give od a proper manual page.

PR:		36783
2002-05-17 07:14:55 +00:00
tjr
4769e48d99 Declare variables that were extern'd in multiple places in hexdump.h.
PR:		36783
2002-05-17 06:32:00 +00:00
tjr
b0a96363c8 Add support for printing long doubles.
PR:		36783
2002-05-17 06:12:25 +00:00
tjr
3e9f4fc172 Print signed single-byte decimal integers correctly instead of implicitly
converting them to unsigned bytes.

PR:		36783
2002-05-17 05:43:00 +00:00
tjr
ed1adbad3e Un-deprecate od(1): rename the deprecated' variable to odmode', remove the
deprecation warning from the utility and manual page. Since this utility
is required by POSIX, it's not likely to be removed any time soon.

This is leading up to the addition of the P1003.1-2001 -s -A -j -N -t options.

PR:		36783
2002-05-17 05:20:30 +00:00
charnier
a07fb1cc07 Use `The .Nm utility' 2002-04-19 23:44:58 +00:00
imp
74d826c7a6 remove __P 2002-03-22 01:22:50 +00:00
obrien
f4d9e1cfbc Slightly more efficient version of rev 1.6. 2002-03-07 23:01:55 +00:00
obrien
26ba134593 A less intrusive version of rev 1.2. 2002-03-07 23:00:27 +00:00
obrien
fb5a0ad0da Slightly more efficient fix to the const problem. 2002-03-07 22:58:16 +00:00
markm
ae2558974f Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
markm
a59a3a99ce WARNS=2 fixups. 2001-12-02 12:09:41 +00:00
ru
156d266334 mdoc(7) police: Fixed the .Ex calls in manpages that describe more
than one utility.

PR:		docs/30437
Submitted by:	SUZUKI Koichi <koich@cac.co.jp>
2001-09-11 12:27:15 +00:00
ache
63ed2f311c File positions are off_t nowdays, not long, so:
strtol -> strtoll
  fseek -> fseeko

  NOTE: that fseek not works for >long offsets files per POSIX:

  [EOVERFLOW] For fseek( ), the resulting file offset would be a value which
  cannot be represented correctly in an object of type long.
2001-09-01 22:42:47 +00:00
ru
bde8ec1b70 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
obrien
56240ae808 Remove the misnamed `emalloc' and replace its uses with the calloc (along
with error checking) that it actually was.
2001-07-24 14:11:09 +00:00
dd
911ca14c87 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
ru
89596e4538 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
ru
b5cd63f616 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
ache
0c50457380 Change localizing to LC_ALL 2001-02-10 23:25:09 +00:00
ru
8a6f8b5fe4 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
ru
6ab0b23323 Prepare for mdoc(7)NG. 2000-12-27 16:52:31 +00:00
ru
e6cfc0711d Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
ru
0d1334ca0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
kris
d84b4d3f4d Oops, missed another printf() invocation with no format string. 2000-07-10 09:07:04 +00:00
kris
9ecdb01e43 Don't call printf() with no format string. 2000-07-10 09:05:31 +00:00
phantom
353c1a6746 Correct spelling : ascii -> ASCII
PR:		docs/13702
Submitted by:	Stephen J. Roznowski <sjr@home.com>
Reviewed by:	mpp
1999-09-20 09:15:23 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
billf
4822432874 Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
dillon
a9cca9c815 PR: bin/9016
Fix bug with od/hd/hexdump. "*" lines are supposed to indicate one or
    duplicates of the previous line, but a small file with less then 16
    characters of zeros in it will be falsy identified as a repeat of
    the (non-existant) previous line.  i.e. the first line of output winds
    up being a "*".  Added a bit of code to handle the degenerate 'there is
    no previous line' case for the first line.
1998-12-13 06:40:18 +00:00
ache
4f252df3ad Localize it 1997-11-04 05:33:15 +00:00
charnier
c4ced555e1 Use err(3) instead of local redefinition, incorporate `hd' in usage str. 1997-07-10 06:48:24 +00:00
steve
f8049f60d8 Fix a minor nit in the .Dd macro invocation so that
the revision date is displayed correctly.
1997-06-23 04:52:13 +00:00
imp
141381e1cb compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
peter
deba7db48c Merge from Lite2 1997-03-11 13:43:33 +00:00
peter
f390c26dd9 Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
wosch
000fb64288 delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
peter
8b748f9115 Fix the previous commit. The second of the 8-character columns was
a duplicate of the first column of 8...
1996-10-04 23:29:38 +00:00
joerg
f811c2ec39 Now that we've already got "hexdump -C", make calling the command "hd"
having the same effect, and install a link for this.  There is
historic precedence for the command hd(1) (with roughly that output
format) in Xenix, SCO, and a few SysV's that tooks the idea.

Also, added a couple of spaces to the -C format to make the output
better readable.

Ok'ed by: phk
1996-09-29 04:17:24 +00:00
phk
132596c18d Add '-C' "Canonical" format to hexdump:
$ hexdump -C /etc/resolv.conf
00000000 64 6f 6d 61 69 6e 20 64 6b 2e 74 66 73 2e 63 6f |domain dk.tfs.co|
00000010 6d 0a 6e 61 6d 65 73 65 72 76 65 72 20 31 34 30 |m.nameserver 140|
00000020 2e 31 34 35 2e 32 33 30 2e 31 30 0a             |.145.230.10.|
1996-09-16 21:18:48 +00:00
wosch
ab0ebe585d [HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
1996-08-29 18:06:19 +00:00
mpp
9fcf3504c2 Correct some cross references and some path names. 1996-04-06 09:47:30 +00:00
mpp
6e83fbce86 Correct some manual page cross reference errors. E.g. su is a section
one man page, not section eight.  This is the first round of such changes
and only fixes man pages in manual section one.
1996-02-02 00:26:12 +00:00
rgrimes
a14d555c87 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
jkh
25006117f1 Change .0 man extents to .1, as reported by Julian Elischer. Whoops,
thought I'd gotten this one the first time around.
Reviewed by:
Submitted by:
1994-08-13 05:00:39 +00:00
rgrimes
f9ab90d9d6 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00