diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-08-25 00:13:55 +0000 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-08-25 00:13:55 +0000 |
commit | b1dadf134bc1d7458a050c3b4ad2ce62652892ad (patch) | |
tree | 8f05be86b2b3731912a8e002a1624415ad2a2c40 /pp.c | |
parent | cf6f4e918622ec80f33cb4c23b8f8c844c6c0755 (diff) | |
download | perl-b1dadf134bc1d7458a050c3b4ad2ce62652892ad.tar.gz |
perl 5.003_03: pp.c
Add support for tied filehandles.
If a regex supplied to split() contains paranthesized subpatterns
that can result in null matches, perl coredumps.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -98,7 +98,13 @@ PP(pp_rv2gv) if (SvROK(sv)) { wasref: sv = SvRV(sv); - if (SvTYPE(sv) != SVt_PVGV) + if (SvTYPE(sv) == SVt_PVIO) { + GV *gv = (GV*) sv_newmortal(); + gv_init(gv, 0, "", 0, 0); + GvIOp(gv) = (IO *)sv; + SvREFCNT_inc(sv); + sv = (SV*) gv; + } else if (SvTYPE(sv) != SVt_PVGV) DIE("Not a GLOB reference"); } else { @@ -3515,7 +3521,7 @@ PP(pp_split) iters++; } else if (!origlimit) { - while (iters > 0 && SvCUR(TOPs) == 0) + while (iters > 0 && (!TOPs || !SvANY(TOPs) || SvCUR(TOPs) == 0)) iters--, SP--; } if (realarray) { |