Commit Graph

65 Commits

Author SHA1 Message Date
ru
21331566c5 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ru
6d8d9001d6 Scheduled mdoc(7) sweep. 2005-01-11 10:32:52 +00:00
tjr
b02f515fbc 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
f3cbaacb09 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
cdda8bd7f5 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
b8e941a73c Revert WARNS bump until I figure out why this does not work. 2004-07-17 20:10:23 +00:00
johan
54f0cd6f44 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
a36c791eff 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
7e878b526b Add a reference to od(1). 2004-07-10 13:11:00 +00:00
tjr
0c076696fd Document missing multibyte character support in utilities specified
by POSIX.
2004-07-03 01:28:21 +00:00
ru
1fd830331f Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
ru
049d95bf04 Capitalize ASCII code names.
Approved by:	re
2002-12-05 08:50:00 +00:00
dwmalone
e3e153e6ce 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
619f7aad5d s/inline/__inline/ 2002-07-19 14:12:27 +00:00
obrien
3cb8dae44d Consistently use FBSDID 2002-06-30 05:25:07 +00:00
ru
069db24a02 mdoc(7) police: tidy up the markup. 2002-05-29 18:49:22 +00:00
tjr
ce5e1ae416 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
720e406dac 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
0b8ca07233 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
d3f5c72dd3 Declare variables that were extern'd in multiple places in hexdump.h.
PR:		36783
2002-05-17 06:32:00 +00:00
tjr
d2f7adaae4 Add support for printing long doubles.
PR:		36783
2002-05-17 06:12:25 +00:00
tjr
9cae8b9c77 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
ff7186f77f 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
75f0c117d4 Use `The .Nm utility' 2002-04-19 23:44:58 +00:00
imp
0338ac6a1a remove __P 2002-03-22 01:22:50 +00:00
obrien
1f44a051a9 Slightly more efficient version of rev 1.6. 2002-03-07 23:01:55 +00:00
obrien
95a49d6685 A less intrusive version of rev 1.2. 2002-03-07 23:00:27 +00:00
obrien
54df1db664 Slightly more efficient fix to the const problem. 2002-03-07 22:58:16 +00:00
markm
72f8b8d824 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
a50c9781f6 WARNS=2 fixups. 2001-12-02 12:09:41 +00:00
ru
a6d24eab16 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
fa4bb533e0 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
e6bcd7b5b8 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
obrien
260957ee90 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
7d1013753f Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
ru
8ec47de9c3 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
ru
128310ec7a mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
ache
dd44993aad Change localizing to LC_ALL 2001-02-10 23:25:09 +00:00
ru
b1c3961564 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
ru
c357ba8f12 Prepare for mdoc(7)NG. 2000-12-27 16:52:31 +00:00
ru
655e7db87e Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
ru
0957874304 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
kris
f61e71f0f8 Oops, missed another printf() invocation with no format string. 2000-07-10 09:07:04 +00:00
kris
993bdb6bcd Don't call printf() with no format string. 2000-07-10 09:05:31 +00:00
phantom
34985ba96d 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
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
billf
251664b7db Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
dillon
a6ee547c92 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
f8a31e6cb3 Localize it 1997-11-04 05:33:15 +00:00
charnier
7a214b4a35 Use err(3) instead of local redefinition, incorporate `hd' in usage str. 1997-07-10 06:48:24 +00:00