Commit Graph

35 Commits

Author SHA1 Message Date
christos 80cd289830 provide _POSIX2_LINE_MAX if not there. 2007-04-17 20:30:29 +00:00
gdamore d9ac053afa Make TOOL_SED, to allow using our own sed in cases where the host's version
is busted in some way.

The TOOL_SED doesn't use TIOCGWINSIZE, and has some changes to include
nbtool_config.h in a cross build environment.

Combined with some other changes (not yet committed), this allows cross
compiling m68k code on Solaris 10/amd64.
2006-06-18 05:16:41 +00:00
mrg 117693dfce when calling compile_tr() add (void *) to the 2nd argument's cast chain. 2006-05-11 17:18:19 +00:00
christos 472d6fbe72 Coverity CID 878: Remove impossible tests against NULL pointers. 2006-04-02 03:47:26 +00:00
matt d0560e80c6 When adding text due to an a, c, or i command, don't eat the space(s) at
the beginning of the lines since the addition is supposed to be "verbatim".
Fix a comment for compile_text indicating it's also used for the 'c' command.
2004-11-17 22:17:54 +00:00
enami 15f238472a Yet another s/xmalloc/xrealloc/ so that large multi line text
can be added.
2004-07-09 23:43:07 +00:00
mycroft 282d260910 xmalloc()->xrealloc() so that patterns larger than _POSIX2_LINE_MAX*2-1 work. 2004-07-09 16:34:29 +00:00
grant 55ed2aadb5 apply patch in PR to avoid writing to unallocated memory.
fixes PR bin/25911 from SHIMIZU Ryo.
2004-06-13 08:34:31 +00:00
grant 1e6747bd53 apply patch in PR to fix argument parsing bug.
fixes PR bin/24234 from Keisuke YOSHIDA.
2004-06-13 08:31:30 +00:00
minskim 5b777c8343 Fix a bug that made sed(1) fail if the last character of the line
buffer was a backslash.  This closes PR bin/25899.

Patch was borrowed from FreeBSD.  Their log says:

    Fix a bug in sed(1)'s "s" command wherein if an escape ("\"
    character) was initiated at the last character of the line buffer,
    the Wrong Thing was done and sed barfed by interpreting the
    following NUL byte as a digit.  Instead, pull up the next buffer
    and record that the "\" was last seen.

OK'ed by jmc@.
2004-06-12 04:29:22 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
wiz 3c4c9d2b57 Remove #if __STDC__. De-__P() and ANSIfy. 2002-06-14 00:41:42 +00:00
itojun f51456c273 err/errx/warn/warnx do not need \n at the end 2002-06-11 06:06:18 +00:00
wiz c640510df0 Correct spelling of "delimiter", and remove from ignored-errors lists. 2002-02-26 02:37:28 +00:00
atatat c25d406046 Add a -E flag to ed(1) and sed(1) so that they can use extended
regular expressions instead of just basic regular expressions.
2002-01-23 19:07:33 +00:00
kleink 3ff80f3170 Accept empty commands separated by semicolons; from Aymeric Vincent in
PR standards/15231.
2002-01-14 19:37:30 +00:00
christos 431b0659ba char -> unsigned char 1998-12-19 22:12:11 +00:00
drochner 20b876f326 avoid malloc(0) 1998-12-08 14:08:50 +00:00
lukem 2237cf10d6 WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF 1997-10-19 23:05:11 +00:00
mrg 59a949ac9c merge lite-2 -- was mostly already done. grr. 1997-10-19 05:23:48 +00:00
tls 9d225a1783 RCS ID police 1997-01-09 20:18:21 +00:00
mycroft 35e8bf367a Compile group commands differently, using a stack rather than calling the
parser recursively.  Don't throw away commands after an end group.
1995-03-09 11:19:24 +00:00
mycroft b01b8d8a74 Fix thinko in previous commit. 1994-11-15 19:03:25 +00:00
mycroft 49ebbb080e Fix core dump on end of group reported by John Kohl, in a different way. 1994-11-09 19:30:32 +00:00
alm b1dcef2867 echo hello | ./sed 'sl[l]lxl'
historically outputs:
hexlo
1994-04-17 04:19:27 +00:00
cgd 8a8b69552f RCS id's 1994-02-03 23:44:40 +00:00
cgd 5beaa48900 update from Diomidis Spinellis <dspin@leon.nrcps.ariadne-t.gr> 1994-02-03 23:32:10 +00:00
mycroft 09dc5c690d Further patch by Havard Eidnes <Havard.Eidnes@runit.sintef.no> to avoid access
to uninitialized memory.
1993-12-05 21:43:57 +00:00
mycroft 824c494570 From: Thomas Eberhardt <thomas@mathematik.uni-Bremen.de>
Patch to prevent core dumping when linked dynamically.
1993-11-20 22:24:17 +00:00
andrew 1b0bd76d80 make with -DHISTORIC_PRACTICE to obtain the common EOF behavior of the "n"
command.  Don't be fussy about requiring spaces after the "w" command
though.
1993-11-04 01:36:21 +00:00
alm b6b50355eb removed GNU_REGEX directive
catch infinite substitution for the following cases:
echo hi | sed 's/$/a/g' (prints hia)
echo hi | sed 's/h*/x/g' (terminates with error: infinite substitution)
1993-08-13 02:26:38 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
alm bd8e434d6d fixed regex initialization 1993-06-16 07:41:14 +00:00
alm 9030436006 Fixed some regex bugs in sed
Added a regresssion test, compile.c.test
1993-05-27 01:14:14 +00:00
alm bb106b2b49 added Berkeley sed with mods to use GNU regex 1993-04-13 23:49:12 +00:00