summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/process.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variables.stefanf2005-04-091-2/+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-3/+59
|
* Overhaul lputs() to deal with multibyte characters, characters that taketjr2004-07-131-24/+53
| | | | up more than one column position, and null bytes.
* Reimplement in-place editing in a slightly less disgusting manner. Also,des2003-11-041-19/+21
| | | | | | | make an effort to preserve the ownership and mode of the file we are editing. Sponsored by: Registrar AS
* Whitespace cleanupdes2003-11-041-11/+11
|
* ANSIfydes2003-11-041-23/+10
|
* Change the buffer length test in NEEDSP() so that it does nottjr2003-11-021-1/+2
| | | | | | | | subtract one unsigned number from another potentially smaller one, leading to wraparound (and heap corruption, eventually). PR: 58813 MFC after: 2 weeks
* Do not dribble zero bytes into the output, by replacing an obfuscated iffanf2003-06-051-4/+1
| | | | | | | | whose true and false clauses were equivalent with a check that we are not about to stumble off the end of the line. Reported by: peter Pointy hat to: fanf
* Fix substitution when the regex matches the zero-length string.fanf2003-06-041-5/+6
| | | | | | | | | There are two bugs: in the s///g case, the substitution didn't occur at the end of the line; in the s///N case, the code didn't count forwards along the line properly. See the sg, s3, s4, and s5 tests in src/tools/regression/usr.bin/sed/. Reviewed by: tjr
* Initialize a variable in order to fix when faced with picky compilers.eric2002-09-201-0/+2
| | | | Sponsored by: Apple
* Correct boundary condition error in `D' and `P' commands when the lasttjr2002-08-111-6/+3
| | | | | | | | line of the pattern space is empty. Don't emit spurious newline when EOF is reached with the `N' command. Pointed out by: Oleg Osyka MFC after: 1 week
* s/inline/__inline/markm2002-07-191-4/+4
|
* Make cspace()'s second argument const. Make `escapes' in lputs() const.tjr2002-07-081-2/+3
|
* Avoid checking whether each line is the last line of the file when we don'ttjr2002-07-031-1/+1
| | | | | | | | | need to know. Instead, check when we are trying to match a "$" address. This does not change the way sed processes regular files, but makes it behave more sensibly when used interactively. PR: 40101 MFC after: 2 weeks
* Don't let the pattern space become null if the `x' command is used when thetjr2002-07-031-0/+2
| | | | | | hold space is null; some functions assume it's never null. MFC after: 3 days
* Fix off by one in `y' (transliterate) command which caused the last charactertjr2002-06-241-1/+1
| | | | | | of the pattern space not to be examined. Noticed by: Motoyuki Konno <motoyuki@bsdclub.org>
* Now that the pattern space contains no trailing newline, modify the `l'tjr2002-06-221-1/+5
| | | | command's output so it's the same as what SUSv3 specifies.
* Don't store newlines at the end of each line in the hold/pattern spaces,tjr2002-06-221-11/+10
| | | | | | | | instead add the newline when the pattern space is printed. Make the `G' and `H' commands add a newline to the space before the data, remove bogus addition of newline from `x' command. PR: 29790, 38195
* Don't write escape newlines with `l' command (SUSv3)tjr2002-06-101-3/+3
|
* Correctly handle global substitutions where the pattern is only "$", thetjr2002-06-101-0/+3
| | | | | EOL anchor, when the last input line does not end in a newline character. Picked up by the GNU sed test suite.
* Wrap lines correctly for the `l' command.tjr2002-06-041-1/+1
|
* Ignore COLUMNS environment variable if it is empty (SUSv3)tjr2002-06-041-1/+1
|
* More consistancy. file system > filesystemtrhodes2002-05-161-1/+1
|
* Fix sed(1) in the case where a last line is specified and hold space is notjmallett2002-04-071-3/+5
| | | | | | | | | | | | | | | | | 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
* Fix sed(1) behaviour for 'G' when given null holdspace by making sure itjmallett2002-04-051-0/+2
| | | | | | | | | | contains a \n. PR: misc/26153 Submitted by: ashp Reviewed by: mike Obtained from: NetBSD MFC after: 2 days
* remove __Pimp2002-03-221-6/+6
|
* WARNS=2 partial fix; use NO_WERROR to protect against some hard-to-fix warnings.markm2001-12-121-11/+10
| | | | Use __FBSDID(), kill register keyword.
* Expand xmalloc in-place, along with xrealloc; which wasn't even ANSI in itsobrien2001-07-241-6/+12
| | | | implementation.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* More egcs warning fixes:imp1999-04-251-2/+3
| | | | | | | | | | 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
* Compile -Wallarchie1998-12-071-2/+2
|
* Make 'y' command 8bit cleanache1998-04-291-2/+2
| | | | PR: 6458
* Remove local redefinition for err(). Add usage().charnier1997-08-111-18/+20
|
* Localize itache1996-08-111-2/+2
| | | | 8bit cleanup
* Merge various fixes from NetBSD. This will allow the WordPerfect forjkh1995-08-161-16/+18
| | | | SCO installation to run all the way through (some POSIX fixes).
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
|
* Correct a bug in the P function: according to 7th edition UNIX (tm), thejmz1995-02-061-1/+1
| | | | | | | | | 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!)
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+629
OpenPOWER on IntegriCloud