diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2001-10-10 19:23:44 +0200 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2001-10-10 14:49:43 +0000 |
commit | 8e5e9ebe73253381295c8c22fd24720255d732e9 (patch) | |
tree | af776933651524f9a51e600df3dcc23e2b74498e /regexec.c | |
parent | 737c380eddfcfb819f42666b6b5bd6171d245f53 (diff) | |
download | perl-8e5e9ebe73253381295c8c22fd24720255d732e9.tar.gz |
two s/// bugfixes
Message-Id: <20011010172344.C22440@rafael>
p4raw-id: //depot/perl@12392
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -2536,11 +2536,18 @@ S_regmatch(pTHX_ regnode *prog) PL_curpad = AvARRAY((AV*)PL_regdata->data[n + 2]); PL_regendp[0] = PL_reg_magic->mg_len = locinput - PL_bostr; - CALLRUNOPS(aTHX); /* Scalar context. */ - SPAGAIN; - ret = POPs; - PUTBACK; - + { + SV **before = SP; + CALLRUNOPS(aTHX); /* Scalar context. */ + SPAGAIN; + if (SP == before) + ret = Nullsv; /* protect against empty (?{}) blocks. */ + else { + ret = POPs; + PUTBACK; + } + } + PL_op = oop; PL_curpad = ocurpad; PL_curcop = ocurcop; |