[perl #77388] Make stacked -T and -B work
authorFather Chrysostomos <sprout@cpan.org>
Thu, 12 Jan 2012 21:24:26 +0000 (13:24 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 12 Jan 2012 21:24:26 +0000 (13:24 -0800)
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
t/op/filetest_stack_ok.t

index ed47ff0..0131a2e 100644 (file)
--- 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) {
index dba5f65..c89428c 100644 (file)
@@ -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");