Do not dribble zero bytes into the output, by replacing an obfuscated if
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
This commit is contained in:
parent
30ef7aacc2
commit
c2b9b6eba8
@ -362,10 +362,7 @@ substitute(cp)
|
|||||||
slen -= match[0].rm_eo;
|
slen -= match[0].rm_eo;
|
||||||
lastempty = 0;
|
lastempty = 0;
|
||||||
} else {
|
} else {
|
||||||
if (match[0].rm_so == 0)
|
if (match[0].rm_so < slen)
|
||||||
cspace(&SS, s, match[0].rm_so + 1,
|
|
||||||
APPEND);
|
|
||||||
else
|
|
||||||
cspace(&SS, s + match[0].rm_so, 1,
|
cspace(&SS, s + match[0].rm_so, 1,
|
||||||
APPEND);
|
APPEND);
|
||||||
s += match[0].rm_so + 1;
|
s += match[0].rm_so + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user