This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The file test operators -s, -A, -C and -M can return false values
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 30 Oct 2008 11:29:50 +0000 (11:29 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 30 Oct 2008 11:29:50 +0000 (11:29 +0000)
that are not undef or "no". Take that into account when stacking them.
This fixes bug #60214.

p4raw-id: //depot/perl@34660

pp_sys.c

index 0181e7e..6bc84d9 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2940,7 +2940,7 @@ PP(pp_stat)
  * Else, discard it from the stack and continue. --rgs
  */
 #define STACKED_FTEST_CHECK if (PL_op->op_private & OPpFT_STACKED) { \
-       if (TOPs == &PL_sv_no || TOPs == &PL_sv_undef) { RETURN; } \
+       if (!SvTRUE(TOPs)) { RETURN; } \
        else { (void)POPs; PUTBACK; } \
     }