When scanning for a heredoc terminator in a string eval or quote-like
operator, the first character we are looking for is always a newline.
So instead of setting term to *PL_tokenbuf in those two code paths,
we can just hard-code '\n'.
break;
}
}
- term = *PL_tokenbuf;
d = s;
while (s < bufend &&
- (*s != term || memNE(s,PL_tokenbuf,len)) ) {
+ (*s != '\n' || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
CopLINE_inc(PL_curcop);
}
goto retval;
}
else if (!infile || found_newline) {
- term = *PL_tokenbuf;
d = s;
while (s < PL_bufend &&
- (*s != term || memNE(s,PL_tokenbuf,len)) ) {
+ (*s != '\n' || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
CopLINE_inc(PL_curcop);
}