summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-03-04 12:50:58 +0000
committerAaron Crane <arc@cpan.org>2017-07-15 19:35:43 +0100
commit20ae58f7a9bbf84d043d6e90f5988b6e3ca4ee3d (patch)
tree9cc42614061f228b5e0ba9ff22dc8b79f096595d /pp.c
parent36f05cd79a2d07c67e7a1ce57cb3d0a1f632bee7 (diff)
downloadperl-20ae58f7a9bbf84d043d6e90f5988b6e3ca4ee3d.tar.gz
RT #130907: Fix the Unicode Bug in split " "
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 768eb7d82a..9ac4b075bc 100644
--- a/pp.c
+++ b/pp.c
@@ -5742,6 +5742,7 @@ PP(pp_split)
STRLEN len;
const char *s = SvPV_const(sv, len);
const bool do_utf8 = DO_UTF8(sv);
+ const bool in_uni_8_bit = IN_UNI_8_BIT;
const char *strend = s + len;
PMOP *pm = cPMOPx(PL_op);
REGEXP *rx;
@@ -5828,6 +5829,10 @@ PP(pp_split)
while (s < strend && isSPACE_LC(*s))
s++;
}
+ else if (in_uni_8_bit) {
+ while (s < strend && isSPACE_L1(*s))
+ s++;
+ }
else {
while (s < strend && isSPACE(*s))
s++;
@@ -5859,6 +5864,10 @@ PP(pp_split)
{
while (m < strend && !isSPACE_LC(*m))
++m;
+ }
+ else if (in_uni_8_bit) {
+ while (m < strend && !isSPACE_L1(*m))
+ ++m;
} else {
while (m < strend && !isSPACE(*m))
++m;
@@ -5893,6 +5902,10 @@ PP(pp_split)
{
while (s < strend && isSPACE_LC(*s))
++s;
+ }
+ else if (in_uni_8_bit) {
+ while (s < strend && isSPACE_L1(*s))
+ ++s;
} else {
while (s < strend && isSPACE(*s))
++s;