summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/compile.c
Commit message (Collapse)AuthorAgeFilesLines
* WARNS fixes:dwmalone2008-02-091-1/+1
| | | | | | | | | | 1) Add missing parens around assignment that is compared to zero. 2) Make some variables that only take non-negative values unsigned. 3) Some casts/type changes to fix other constness warnings. 4) Make one variable a const char *. 5) Make sure termwidth is positive, it doesn't make sense for it to be negative. Approved by: dds
* Before doing compile_re() which needs a parameter to identifydelphij2007-07-061-4/+4
| | | | | | | | | | | whether we should ignore case, determine the flag by calling compile_flags() first. Also, make sure that we obtain an initialized cmd->u.s buffer before processing further. We may want to refine this solution later, but for now, make the changes in order to unbreak world build after a sed(1) with rev. 1.29 of compile.c is installed. Approved by: re (hrs)
* Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.ssouhlal2007-07-041-25/+41
| | | | | | | | | For example, sed /foo/Id sed s/foo/bar/Ig Reviewed by: dds Approved by: re (hrs)
* Bug fix: a numeric flag specification in the substitute command woulddds2005-08-041-2/+8
| | | | | | | | cause the next substitute flag to be ignored. While working at it, detect and report overflows. Reported by: Jingsong Liu MFC after: 1 week
* Fix dubious C code construct.stefanf2005-03-091-1/+1
|
* Per letter dated July 22, 1999 remove 3rd clause of Berkeley deriveddds2004-08-091-4/+0
| | | | | | software (original contributor). Reviewed by: imp
* Make the 'y' (translate) command aware of multibyte characters.tjr2004-07-141-13/+69
|
* Whitespace cleanupdes2003-11-041-10/+10
|
* ANSIfydes2003-11-041-34/+15
|
* Ignore leading semicolons on commands; required by SUSv3.tjr2002-07-301-2/+8
| | | | Obtained from: NetBSD (kleink, Aymeric Vincent)
* Fix a bug in sed(1)'s "s" command wherein if an escape ("\" character)green2002-06-011-4/+24
| | | | | | | 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.
* Fix an ages-old bug in sed(1), which resulted in the absolutely validsobomax2002-04-121-1/+1
| | | | | | | | substitution expressions in the form `s,[fooexp],[barexp],;...' treated as invalid when the third `,' is (_POSIX2_LINE_MAX * N)-th character in the line. MFC after: 2 weeks
* remove __Pimp2002-03-221-14/+14
|
* WARNS=2 partial fix; use NO_WERROR to protect against some hard-to-fix warnings.markm2001-12-121-18/+18
| | | | Use __FBSDID(), kill register keyword.
* Don't allocate a zero byte segment.mikeh2001-11-081-1/+4
| | | | | PR: bin/11900 MFC after: 2 weeks
* Expand xmalloc in-place, along with xrealloc; which wasn't even ANSI in itsobrien2001-07-241-17/+36
| | | | implementation.
* Don't leak memory when compiling text following the `a', `c' or `i' command.ru2001-05-181-1/+1
| | | | | | | | | Testcase: echo FOO | sed "/FOO/c\\ `jot -b 'aaaa\' 500`" Submitted by: Max Khon <fjoe@newst.net>
* Add a new flag: -E enables "extended" regular expressions.green2000-03-191-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix a new bug introduced by the previous bug fixarchie1998-12-081-6/+7
|
* Fix brokenness compiling "s/pat/subst/" when length of subst is >= 4090 chars.archie1998-12-071-3/+6
| | | | PR: bin/7939
* Terminate our output string correctly if we've gotbrian1998-09-221-1/+2
| | | | | | | an ``a'' command that has an escaped newline on the last line of the last script that we're processing. This fixes exmh2/scripts/build when /etc/malloc.conf -> AJ
* Remove local redefinition for err(). Add usage().charnier1997-08-111-61/+72
|
* Localize itache1996-08-111-2/+2
| | | | 8bit cleanup
* Yet^2 another fix for the line continuation bug.bde1996-07-171-5/+5
| | | | | | | | | | | | The fundamental problem with the original code is that it accesses p[-2] which is one before the beginning of the input buffer for empty lines. rev.1.6 just moved the problem from failures when p[-2] happens to be '\\' to failures when it happens to be '\0'. rev.1.5 was confused about the trailing newline and other things. I went back to rev.1.5 and fixed it. The result is the same as Keith Bostic's final version in PR 1356 except it loses more gracefully for excessively long input lines.
* Yet another fix for the line continuation bug in sed. Keith's patchdg1996-06-261-7/+5
| | | | | | introduced a new bug. This fix appears to work correctly. Fixes PR#1350. Submitted by: mark@linus.demon.co.uk (Mark Valentine)
* Fix from Keith Bostic <bostic@bsdi.com> for bug in sed dealing withdg1996-06-191-5/+7
| | | | | | continuation lines. Submitted by: Keith Bostic via Kirk McKusick
* Merge various fixes from NetBSD. This will allow the WordPerfect forjkh1995-08-161-31/+68
| | | | SCO installation to run all the way through (some POSIX fixes).
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* Sed dumps core when linked with some coalescing malloc because itjoerg1995-04-051-0/+2
| | | | | | doesn't initialize malloced structure. Submitted by: vode@hut.fi
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+771
OpenPOWER on IntegriCloud