diff options
author | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2007-06-28 20:06:50 +0000 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2007-06-28 22:09:07 +0000 |
commit | 0ac6acaed7c2092a5668c6b70ddeaf3003e989d8 (patch) | |
tree | b180dc08771b7c5e7480dd8f7ae97cec29d279a2 /regcomp.c | |
parent | 0df5f63f6809bbf24ffde62fa2804f0041470b74 (diff) | |
download | perl-0ac6acaed7c2092a5668c6b70ddeaf3003e989d8.tar.gz |
Move the RXf_WHITE logic for split " " into the regex engine
From: "Ævar Arnfjörð Bjarmason"
<avarab@gmail.com>
Message-ID: <51dd1af80706281306i4dbba39em3eeb8da1d67ea27c@mail.gmail.com>
(with tweaks)
p4raw-id: //depot/perl@31495
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4751,8 +4751,12 @@ reStudy: r->paren_names = (HV*)SvREFCNT_inc(RExC_paren_names); else r->paren_names = NULL; - if (r->prelen == 3 && strnEQ("\\s+", r->precomp, 3)) /* precomp = "\\s+)" */ - r->extflags |= RXf_WHITE; + + if (r->extflags & RXf_SPLIT && r->prelen == 1 && r->precomp[0] == ' ') + /* XXX: this should happen BEFORE we compile */ + r->extflags |= (RXf_SKIPWHITE|RXf_WHITE); + else if (r->prelen == 3 && memEQ("\\s+", r->precomp, 3)) + r->extflags |= RXf_WHITE; else if (r->prelen == 1 && r->precomp[0] == '^') r->extflags |= RXf_START_ONLY; |