diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-11-27 20:51:56 -0500 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-28 19:30:06 +0000 |
commit | 8f580fb8c3adcd8061f0e72f718bbf4ff930d697 (patch) | |
tree | af6f381f84ea6a17ce41b3bd1f28f207fe375cba /mg.c | |
parent | 5c5e4c245abefef949ee72dd179eff31d923dcb2 (diff) | |
download | perl-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |