summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-12 13:17:59 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-12 13:17:59 -0800
commite5e154d26bf2e9766b86a93f4af780f8b005349e (patch)
tree89ded710f86501579f9a209c7728b5ba28c1bfe2 /pp_sys.c
parent3f12cff414d1c6ec878a7e1a4ed270a421a8a75e (diff)
downloadperl-e5e154d26bf2e9766b86a93f4af780f8b005349e.tar.gz
Make -t, -T and -B with a handle pop it off the stack
This is something I broke carelessly with commit 094a3eec8. No, this does not fix bug #77388.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pp_sys.c b/pp_sys.c
index e9958b38b3..ed47ff014c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3258,15 +3258,17 @@ PP(pp_fttty)
if (PL_op->op_flags & OPf_REF)
gv = cGVOP_gv;
- else if (!(gv = MAYBE_DEREF_GV_nomg(TOPs))) {
- tmpsv = POPs;
+ else {
+ tmpsv = POPs;
+ if (!(gv = MAYBE_DEREF_GV_nomg(tmpsv))) {
name = SvPV_nomg(tmpsv, namelen);
gv = gv_fetchpvn_flags(name, namelen, SvUTF8(tmpsv), SVt_PVIO);
+ }
}
if (GvIO(gv) && IoIFP(GvIOp(gv)))
fd = PerlIO_fileno(IoIFP(GvIOp(gv)));
- else if (tmpsv && SvOK(tmpsv)) {
+ else if (!gv && SvOK(tmpsv)) {
if (isDIGIT(*name))
fd = atoi(name);
else
@@ -3297,7 +3299,7 @@ PP(pp_fttext)
STDCHAR tbuf[512];
register STDCHAR *s;
register IO *io;
- register SV *sv;
+ register SV *sv = NULL;
GV *gv;
PerlIO *fp;
@@ -3307,7 +3309,7 @@ PP(pp_fttext)
if (PL_op->op_flags & OPf_REF)
gv = cGVOP_gv;
- else gv = MAYBE_DEREF_GV_nomg(TOPs);
+ else sv = POPs, gv = MAYBE_DEREF_GV_nomg(sv);
if (gv) {
EXTEND(SP, 1);
@@ -3357,7 +3359,6 @@ PP(pp_fttext)
}
}
else {
- sv = POPs;
really_filename:
PL_statgv = NULL;
PL_laststype = OP_STAT;