summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-11-27 20:51:56 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-11-28 19:30:06 +0000
commit8f580fb8c3adcd8061f0e72f718bbf4ff930d697 (patch)
treeaf6f381f84ea6a17ce41b3bd1f28f207fe375cba /mg.c
parent5c5e4c245abefef949ee72dd179eff31d923dcb2 (diff)
downloadperl-8f580fb8c3adcd8061f0e72f718bbf4ff930d697.tar.gz
Change $#+
Message-Id: <199811280651.BAA18095@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2373
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index e960c9354a..ba90227a70 100644
--- a/mg.c
+++ b/mg.c
@@ -326,8 +326,13 @@ magic_regdata_cnt(SV *sv, MAGIC *mg)
register REGEXP *rx;
char *t;
- if (PL_curpm && (rx = PL_curpm->op_pmregexp))
- return rx->lastparen;
+ if (PL_curpm && (rx = PL_curpm->op_pmregexp)) {
+ if (mg->mg_obj) /* @+ */
+ return rx->nparens;
+ else /* @- */
+ return rx->lastparen;
+ }
+
return (U32)-1;
}