diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-09-26 19:38:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-09-26 19:39:20 +1300 |
commit | ee5262f15d673094ee13f8d30247bc96a54b34ae (patch) | |
tree | d8e7679a2f7014de8e1ec2d81d875d832ce869ea /checkem | |
parent | Use lstat() not stat() (diff) | |
download | checkem-ee5262f15d673094ee13f8d30247bc96a54b34ae.tar.gz (sig) checkem-ee5262f15d673094ee13f8d30247bc96a54b34ae.zip |
Detect plain file and not symlink correctlyv2.17
Use S_ISREG() rather than S_IFREF comparison
Diffstat (limited to 'checkem')
-rwxr-xr-x | checkem | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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}; |