Commit
c410dd6ad7 indiscriminately pops elements from the stack
even when nothing has been pushed: file tests without arguments
(testing $_) and stacked filetests don't have anything on the
stack that needs to be removed.
The general idea is that we need to have the same side effects
as if we had called my_stat_flags(), so we shall only call POPs
under the same conditions as the code in my_stat_flags().
}
tryAMAGICftest_MG(opchar);
+ STACKED_FTEST_CHECK;
+
/* I believe that all these three are likely to be defined on most every
system these days. */
#ifndef S_ISUID
if(PL_op->op_type == OP_FTSUID) {
- (void) POPs;
+ if ((PL_op->op_flags & OPf_REF) == 0 && (PL_op->op_private & OPpFT_STACKED) == 0)
+ (void) POPs;
RETPUSHNO;
}
#endif
#ifndef S_ISGID
if(PL_op->op_type == OP_FTSGID) {
- (void) POPs;
+ if ((PL_op->op_flags & OPf_REF) == 0 && (PL_op->op_private & OPpFT_STACKED) == 0)
+ (void) POPs;
RETPUSHNO;
}
#endif
#ifndef S_ISVTX
if(PL_op->op_type == OP_FTSVTX) {
- (void) POPs;
+ if ((PL_op->op_flags & OPf_REF) == 0 && (PL_op->op_private & OPpFT_STACKED) == 0)
+ (void) POPs;
RETPUSHNO;
}
#endif
- STACKED_FTEST_CHECK;
-
result = my_stat_flags(0);
SPAGAIN;
if (result < 0)