summaryrefslogtreecommitdiff
path: root/ext/re/re.xs
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-01-31 00:58:31 +0100
committerH.Merijn Brand <h.m.brand@xs4all.nl>2007-01-31 10:29:59 +0000
commitbcdf74043c1fd4b60b7764f5cd7d87525cf77e74 (patch)
tree0a3acc4337796c1ed8e000810e9ecaa82ec42e5a /ext/re/re.xs
parent57b84237ab396aa1e1efe3b629c2b636d4869d93 (diff)
downloadperl-bcdf74043c1fd4b60b7764f5cd7d87525cf77e74.tar.gz
Improve regex stringification code
Message-ID: <9b18b3110701301458k2f6a8254hea6c6db28489c38b@mail.gmail.com> p4raw-id: //depot/perl@30084
Diffstat (limited to 'ext/re/re.xs')
-rw-r--r--ext/re/re.xs7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/re/re.xs b/ext/re/re.xs
index aa601cf67d..1bc20fc2bc 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -120,7 +120,7 @@ PPCODE:
modifiers" in this scenario.
*/
- char *fptr = "msix";
+ char *fptr = INT_PAT_MODS;
char ch;
U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME) >> 12);
@@ -140,11 +140,8 @@ PPCODE:
XSRETURN(2);
} else {
/* Scalar, so use the string that Perl would return */
- if (!mg->mg_ptr)
- CALLREG_STRINGIFY(mg,0,0);
-
/* return the pattern in (?msix:..) format */
- pattern = sv_2mortal(newSVpvn(mg->mg_ptr,mg->mg_len));
+ pattern = sv_2mortal(newSVpvn(re->wrapped,re->wraplen));
if (re->extflags & RXf_UTF8)
SvUTF8_on(pattern);
XPUSHs(pattern);