aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-09-26 19:38:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-09-26 19:39:20 +1300
commitee5262f15d673094ee13f8d30247bc96a54b34ae (patch)
treed8e7679a2f7014de8e1ec2d81d875d832ce869ea
parentUse lstat() not stat() (diff)
downloadcheckem-ee5262f15d673094ee13f8d30247bc96a54b34ae.tar.gz (sig)
checkem-ee5262f15d673094ee13f8d30247bc96a54b34ae.zip
Detect plain file and not symlink correctlyv2.17
Use S_ISREG() rather than S_IFREF comparison
-rwxr-xr-xcheckem6
1 files 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};