From ba8182f85e239b53e3089116cd5a3d262a629667 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 12 Jan 2012 13:24:26 -0800 Subject: [PATCH] [perl #77388] Make stacked -T and -B work They just need to pick up the _ filehandle in stacked mode, like the other ops (which actually rely on my_stat[_flags] to do it). This apparently was forgotten when stacked filetests were added. --- pp_sys.c | 2 ++ t/op/filetest_stack_ok.t | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pp_sys.c b/pp_sys.c index ed47ff0..0131a2e 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3309,6 +3309,8 @@ PP(pp_fttext) if (PL_op->op_flags & OPf_REF) gv = cGVOP_gv; + else if (PL_op->op_private & OPpFT_STACKED) + gv = PL_defgv; else sv = POPs, gv = MAYBE_DEREF_GV_nomg(sv); if (gv) { diff --git a/t/op/filetest_stack_ok.t b/t/op/filetest_stack_ok.t index dba5f65..c89428c 100644 --- a/t/op/filetest_stack_ok.t +++ b/t/op/filetest_stack_ok.t @@ -37,7 +37,7 @@ for my $op (@ops) { } elsif ($count == 1) { local $TODO; - if ($op eq 'T' or $op eq 't' or $op eq 'B') { + if ($op eq 't') { $TODO = "[perl #77388] stacked file test does not work with -$op"; } is($m, "d", "-$op -e \$^X did not remove too many values from the stack"); -- 2.7.4