mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue