From ee5262f15d673094ee13f8d30247bc96a54b34ae Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 26 Sep 2017 19:38:24 +1300 Subject: Detect plain file and not symlink correctly Use S_ISREG() rather than S_IFREF comparison --- checkem | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checkem b/checkem index 9715acc..f2f031b 100755 --- a/checkem +++ b/checkem @@ -26,7 +26,7 @@ use File::Find; use Digest; # Version number to make Perl::Critic happy -our $VERSION = 2.16; +our $VERSION = 2.17; # Complain if there are no arguments if ( !@ARGV ) { @@ -75,8 +75,8 @@ find { # Pull in the stat values we care about if ( @f{ keys %STATS } = ( lstat $f{name} )[ values %STATS ] ) { - # Check it's a regular file - return if not $f{mode} & S_IFREG; + # Check it's a plain old file + return if not S_ISREG( $f{mode} ); # Check its size is non-zero return if not $f{size}; -- cgit v1.2.3