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:
parent
e2eca5fe3e
commit
03fef72fe9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98082
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user