Commit Graph

15 Commits

Author SHA1 Message Date
Juli Mallett
ae17860040 Fix sed(1) in the case where a last line is specified and hold space is not
specified, and then the first part of the pattern space is deleted, when
there are two or more input lines, as this results in subtraction of one from
an unsigned integral value of '0'.  That bogus value is used in one case
for a loop (that will run far too many times in this case) and a function to
search for a value within a specified range of memory, however now the range
of memory is obscenely large and a segmentation fault will occur.  This is
fixed by checking for and appropriately handling a nil pattern space as if
the specified search in memory failed, as indeed it obviously will with nil
pattern space.

Submitted by:	Tim J. Robbins <tim@robbins.dropbear.id.au>
PR:		bin/34813
Reviewed by:	mike
MFC after:	1 day
2002-04-07 02:29:56 +00:00
Juli Mallett
acf9afb7a3 Fix sed(1) behaviour for 'G' when given null holdspace by making sure it
contains a \n.

PR:		misc/26153
Submitted by:	ashp
Reviewed by:	mike
Obtained from:	NetBSD
MFC after:	2 days
2002-04-05 05:40:20 +00:00
Warner Losh
3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Mark Murray
e74bf75f1c WARNS=2 partial fix; use NO_WERROR to protect against some hard-to-fix warnings.
Use __FBSDID(), kill register keyword.
2001-12-12 23:20:16 +00:00
David E. O'Brien
8e33c0a0f6 Expand xmalloc in-place, along with xrealloc; which wasn't even ANSI in its
implementation.
2001-07-24 14:05:21 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Warner Losh
96846ff646 More egcs warning fixes:
o main returns int not void
	o use return 0 at end of main when needed
	o use braces to avoid potentially ambiguous else
	o don't default to type int
	o #ifdef 0 -> #if 0

Reviewed by: obrien and chuckr
1999-04-25 22:37:58 +00:00
Archie Cobbs
2806aab73b Compile -Wall 1998-12-07 05:33:39 +00:00
Andrey A. Chernov
3492193d0e Make 'y' command 8bit clean
PR: 6458
1998-04-29 21:58:36 +00:00
Philippe Charnier
73a08bb2ad Remove local redefinition for err(). Add usage(). 1997-08-11 07:21:08 +00:00
Andrey A. Chernov
726aebe5e0 Localize it
8bit cleanup
1996-08-11 17:46:35 +00:00
Jordan K. Hubbard
ce19262d8c Merge various fixes from NetBSD. This will allow the WordPerfect for
SCO installation to run all the way through (some POSIX fixes).
1995-08-16 05:56:44 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Jean-Marc Zucconi
30ad8d9349 Correct a bug in the P function: according to 7th edition UNIX (tm), the
newline must be part of the pattern space i.e. `echo a|sed -e P' must print
a
a
and not
aa
This is consistent with gnu sed, SunOS, Ultrix (and probably others!)
1995-02-06 00:14:50 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00