Correctly handle global substitutions where the pattern is only "$", the

EOL anchor, when the last input line does not end in a newline character.
Picked up by the GNU sed test suite.
This commit is contained in:
Tim J. Robbins 2002-06-10 06:06:20 +00:00
parent e2eca5fe3e
commit 03fef72fe9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98082

View File

@ -360,6 +360,9 @@ substitute(cp)
s += match[0].rm_eo;
slen -= match[0].rm_eo;
lastempty = 0;
} else if (match[0].rm_so == slen) {
s += match[0].rm_so;
slen = 0;
} else {
if (match[0].rm_so == 0)
cspace(&SS, s, match[0].rm_so + 1,