summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-10-30 16:12:02 +0000
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:25:48 +0100
commit8005796e5264eb0df85cf3c0e4517ca3d769650f (patch)
tree06ca6490cb515ba51ef62d6e838c3cb24beb45fa /regcomp.c
parent525ef3318377af74a8bc34655479e0602a0855cf (diff)
downloadperl-8005796e5264eb0df85cf3c0e4517ca3d769650f.tar.gz
Revert 4 regex commits to ease rebasing
Revert "Remove some repeated code in pp_regcomp" This reverts commit 3e1022372a8200bc4c7354e0f588c7f71584a888. Revert "regcomp.c: Use no_mg for 2nd fetch of pattern" This reverts commit 3e0b93e82af0f1a033bcdb918b413113f1d61cf0. ` Revert "PATCH: [perl #101940]: BBC Tk" This reverts commit 11951bcbfcaf4c260b0da0421e72fc80b4654f17. Revert "Fix =~ $str_overloaded (5.10 regression)" This reverts commit 15d9c083b08647e489d279a1059b4f14a3df187b. These four recent commits on the blead branch overlap with work on the re_eval branch. To make rebasing re_eval easier, revert them at the beginning of the re_eval branch. Any remaining value will be re-added later in the re_eval branch.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/regcomp.c b/regcomp.c
index 4421d3762f..6bcd8b7884 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5034,14 +5034,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
}
#endif
- exp = SvPV(pattern, plen);
-
- if (plen == 0) { /* ignore the utf8ness if the pattern is 0 length */
- RExC_utf8 = RExC_orig_utf8 = 0;
- }
- else {
- RExC_utf8 = RExC_orig_utf8 = SvUTF8(pattern);
- }
+ RExC_utf8 = RExC_orig_utf8 = SvUTF8(pattern);
RExC_uni_semantics = 0;
RExC_contains_locale = 0;
@@ -5053,7 +5046,12 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
}
if (jump_ret == 0) { /* First time through */
+ exp = SvPV(pattern, plen);
xend = exp + plen;
+ /* ignore the utf8ness if the pattern is 0 length */
+ if (plen == 0) {
+ RExC_utf8 = RExC_orig_utf8 = 0;
+ }
DEBUG_COMPILE_r({
SV *dsv= sv_newmortal();
@@ -5085,9 +5083,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
-- dmq */
DEBUG_PARSE_r(PerlIO_printf(Perl_debug_log,
"UTF8 mismatch! Converting to utf8 for resizing and compile\n"));
- exp = (char*)Perl_bytes_to_utf8(aTHX_
- (U8*)SvPV_nomg(pattern, plen),
- &len);
+ exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)SvPV(pattern, plen), &len);
xend = exp + len;
RExC_orig_utf8 = RExC_utf8 = 1;
SAVEFREEPV(exp);