From: Ilya Zakharevich Date: Wed, 8 Jul 1998 07:03:51 +0000 (-0400) Subject: manually apply patch with a dependency on unapplied patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1bd3ad17f2b89c5c7610c541aa9f8fd2ae783e7f;p=p5sagit%2Fp5-mst-13.2.git manually apply patch with a dependency on unapplied patch Message-Id: <199807081103.HAA25145@monk.mps.ohio-state.edu> Subject: [PATCH 5.004_70] make quoted RE embeddable p4raw-id: //depot/perl@1383 --- diff --git a/sv.c b/sv.c index 60972b4..b462127 100644 --- a/sv.c +++ b/sv.c @@ -1706,10 +1706,18 @@ sv_2pv(register SV *sv, STRLEN *lp) == (SVs_OBJECT|SVs_RMG)) && strEQ(s=HvNAME(SvSTASH(sv)), "Regexp") && (mg = mg_find(sv, 'r'))) { - regexp *re = (regexp *)mg->mg_obj; - - *lp = re->prelen; - return re->precomp; + if (!mg->mg_ptr) { + regexp *re = (regexp *)mg->mg_obj; + + mg->mg_len = re->prelen + 4; + New(616, mg->mg_ptr, mg->mg_len + 1, char); + Copy("(?:", mg->mg_ptr, 3, char); + Copy(re->precomp, mg->mg_ptr+3, re->prelen, char); + mg->mg_ptr[mg->mg_len - 1] = ')'; + mg->mg_ptr[mg->mg_len] = 0; + } + *lp = mg->mg_len; + return mg->mg_ptr; } /* Fall through */ case SVt_NULL: diff --git a/t/op/pat.t b/t/op/pat.t index 7ee1f09..a4335b0 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -440,7 +440,7 @@ print "ok $test\n"; $test++; # This should be changed to qr/\b\v$/ ASAP -print "not " unless study(/\b\v$/) eq '\bv$'; +print "not " unless study(/\b\v$/) eq '(?:\bv$)'; print "ok $test\n"; $test++;