History log of /openbsd-src/usr.bin/sed/process.c (Results 1 – 25 of 39)
Revision Date Author Comments
# 8a7444b3 10-Dec-2024 millert <millert@openbsd.org>

The "c" command should start the next cycle as clarified in POSIX
2024. This is also consistent with historical behavior.
Prompted by Mohamed Akram with a diff from uwe@netbsd.


# 01c98acc 28-Aug-2024 millert <millert@openbsd.org>

Fix the case where the pattern space is empty but does not start
with a NUL character, which might occur after using the D command.
From Mohamed Akram


# 58b8553b 17-Jul-2024 millert <millert@openbsd.org>

sed: use warn()/err() where appropriate

Use warn()/err() instead of sed's homegrown warning()/error() for
things other than parser problems. The warning()/error() functions
display the file and lin

sed: use warn()/err() where appropriate

Use warn()/err() instead of sed's homegrown warning()/error() for
things other than parser problems. The warning()/error() functions
display the file and line number in addition to the error message.
This also removes of the COMPILE/FATAL argument to error() since
now all calls to error() are for compilation/parsing issues.
OK op@ espie@

show more ...


# f73b4cc0 18-Jun-2024 millert <millert@openbsd.org>

Rename mf_fgets() and cu_fgets() to mf_getline() and cu_getline().
These functions now use getline(), not fgets(). From espie@


# 4ad58405 12-Jan-2022 martijn <martijn@openbsd.org>

Make lputs use psl instead of expecting it to be null-terminated.
This allows us to enable the commandl1 and commandl2 regress tests.

Original analysis from seL4 <at> disroot <dot> org
OK millert@


# 442efec3 14-Nov-2018 martijn <martijn@openbsd.org>

Make sed's -i flag more compatible with what gsed does.
- Reset the hold-space in between files
- quit the editor as soon as a 'q' command is found
- Make sure the temp-file is written back to the or

Make sed's -i flag more compatible with what gsed does.
- Reset the hold-space in between files
- quit the editor as soon as a 'q' command is found
- Make sure the temp-file is written back to the original file if we quit
the editor

temp-file not written back issue found by Time Chase.
Lots of feedback from millert@ and schwarze@
OK millert@

show more ...


# 59d77f5c 13-Dec-2017 millert <millert@openbsd.org>

Fix sign compare warnings; OK martijn@


# 5360f0f3 22-Feb-2017 tom <tom@openbsd.org>

Remove unused-with-dead-store variable oldpsanl.

From Daniel Cegielka - thanks

ok jca@


# 38b9eeb9 21-Jan-2017 krw <krw@openbsd.org>

Nuke more whitespace caught in the headlights of "warning:"
rectification.


# 5c4e30b8 20-Jan-2017 krw <krw@openbsd.org>

Split error() into error() and warning() so error() can be marked __dead to
appease gcc.

ok procter@ deraadt@


# 3cffad66 11-Oct-2016 martijn <martijn@openbsd.org>

Fix an off by one error when no matches were found in a substitute.
By pfg@ from FreeBSD

OK millert@ and otto@


# 5fee88f8 30-May-2016 martijn <martijn@openbsd.org>

Make sed use the new REG_STARTEND | REG_NOTBOL combination. This fixes a begin
of word mismatch as reported by jsg@.

Discussed with otto@ and others early on, earlier version tested in ports build
b

Make sed use the new REG_STARTEND | REG_NOTBOL combination. This fixes a begin
of word mismatch as reported by jsg@.

Discussed with otto@ and others early on, earlier version tested in ports build
by aja@

OK millert@
Few readability tweaks and OK schwarze@

show more ...


# 3ec97946 26-Oct-2015 mmcc <mmcc@openbsd.org>

Rename err() to error() to prevent confusion with the stdlib function.

Discussed with jca@.


# 1c34c614 20-Jul-2015 jasper <jasper@openbsd.org>

fix eyesore whitespace


# f9142e5b 19-Jul-2015 deraadt <deraadt@openbsd.org>

figure out the linewidth at initialization, rather than late
ok tedu miod


# 96ea96d2 17-Jul-2015 jasper <jasper@openbsd.org>

add -i flag to sed to do in-place editing; mostly based on freebsd

feedback/ok deraadt@ millert@


# a47b6461 18-Apr-2015 deraadt <deraadt@openbsd.org>

Convert many atoi() calls to strtonum(), adding range checks and failure
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert


# 387c92ab 13-Apr-2015 deraadt <deraadt@openbsd.org>

correct multiplication idiom during xreallocarray, and expand appendnum
to size_t to avoid overflow after allocation success
ok guenther doug


# 194de1b6 12-Dec-2014 jsg <jsg@openbsd.org>

Rework the pointer swap in the 'P' command to make the intent
clearer and avoid a crash on 'g;P' found by Sebastien Marie with
the afl fuzzer.


# 7a4520ce 01-Dec-2014 deraadt <deraadt@openbsd.org>

sed has a xreallocarray(), but two n*s cases were not replaced


# f69332c7 28-Nov-2013 deraadt <deraadt@openbsd.org>

unsigned char for ctype
ok krw okan


# 9b668f2f 17-Sep-2011 schwarze <schwarze@openbsd.org>

Rewrite the main loop of the "sed s/..." command, to fix multiple
issues regarding the replacement of zero-length strings.

This commit brings back rev. 1.16, but without the regression that
forced t

Rewrite the main loop of the "sed s/..." command, to fix multiple
issues regarding the replacement of zero-length strings.

This commit brings back rev. 1.16, but without the regression that
forced the backout: No NUL bytes will be output now, not even when
the input file lacks a trailing newline character and there is a
zero-length match at the end.

OK otto@ deraadt@;
and naddy@ (who originally found the regression) checked that
the regression is indeed fixed.

show more ...


# b9445435 26-Jul-2011 schwarze <schwarze@openbsd.org>

Backout previous, naddy@ found the following regression:
When the input does not end in a trailing newline character
and there is an empty match at the end, the new code adds
a spurious '\0' characte

Backout previous, naddy@ found the following regression:
When the input does not end in a trailing newline character
and there is an empty match at the end, the new code adds
a spurious '\0' character.
I have a fix, but otto@ prefers backout and full re-evaluation
after release.

show more ...


# ef4c7e31 24-Jul-2011 schwarze <schwarze@openbsd.org>

Rewrite the main loop of the "sed s/..." command, shortening it by ten
lines and simplifying it by removing the switch statement implementing
/g, /1, and /2 separately and repetitively.
The idea to m

Rewrite the main loop of the "sed s/..." command, shortening it by ten
lines and simplifying it by removing the switch statement implementing
/g, /1, and /2 separately and repetitively.
The idea to make the loop control variable slen, i.e. the length of the
string remaining to be processed, signed, and stay in the loop even when
slen == 0 (i.e. at the end of the string), lifted from FreeBSD by otto@.
On i386, process.o shrinks by 440 bytes, and the sed binary by 23 bytes.

This fixes multiple aspects of the replacement of multiple (/g) or
specific (e.g. /2) instances of zero-length matches, both with BREs and
EREs, both with and without a trailing newline character on the input.

Feedback and OK otto@.

show more ...


# 043fbe51 27-Oct-2009 deraadt <deraadt@openbsd.org>

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(th

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

show more ...


12