diff options
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -5299,6 +5299,7 @@ PP(pp_split) STRLEN len; const char *s = SvPV_const(sv, len); const bool do_utf8 = DO_UTF8(sv); + const bool skipwhite = PL_op->op_flags & OPf_SPECIAL; const char *strend = s + len; PMOP *pm; REGEXP *rx; @@ -5329,7 +5330,7 @@ PP(pp_split) rx = PM_GETRE(pm); TAINT_IF(get_regex_charset(RX_EXTFLAGS(rx)) == REGEX_LOCALE_CHARSET && - (RX_EXTFLAGS(rx) & (RXf_WHITE | RXf_SKIPWHITE))); + (RX_EXTFLAGS(rx) & RXf_WHITE || skipwhite)); RX_MATCH_UTF8_set(rx, do_utf8); @@ -5369,7 +5370,7 @@ PP(pp_split) } base = SP - PL_stack_base; orig = s; - if (RX_EXTFLAGS(rx) & RXf_SKIPWHITE) { + if (skipwhite) { if (do_utf8) { while (*s == ' ' || is_utf8_space((U8*)s)) s += UTF8SKIP(s); @@ -5391,7 +5392,7 @@ PP(pp_split) if (!limit) limit = maxiters + 2; - if (RX_EXTFLAGS(rx) & RXf_WHITE) { + if (RX_EXTFLAGS(rx) & RXf_WHITE || skipwhite) { while (--limit) { m = s; /* this one uses 'm' and is a negative test */ |