From: Chris Koeritz Date: Fri, 1 May 2015 23:36:33 +0000 (-0400) Subject: thanks perl for not complaining about the erroneous int compare instead of eq for... X-Git-Tag: 2.140.90~642 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=0367a8400255fcd00c76c80c146b764a2a995f6f;p=feisty_meow.git thanks perl for not complaining about the erroneous int compare instead of eq for strings. --- diff --git a/scripts/files/summing_dir.pl b/scripts/files/summing_dir.pl index 43215cca..4aa2031c 100644 --- a/scripts/files/summing_dir.pl +++ b/scripts/files/summing_dir.pl @@ -38,22 +38,19 @@ if ($#ARGV < 0) { } foreach $dir (@arg_list) { - if ($dir == "-al") { next; } # skip ls directives. - if ($dir == "-l") { next; } # skip ls directives. + if ($dir eq "-al") { next; } # skip ls directives. + if ($dir eq "-l") { next; } # skip ls directives. $chewed_line = $chewed_line . " \"$dir\""; } if ("$chewed_line" eq "") { -# print "No files matched that path specification.\n"; -# exit 0; - $chewed_line = "." + print "No files matched that path specification.\n"; + exit 0; } # show the header, now that we know there's something to print. print "[" . $print_list . "]\n\n"; -##print "chewed_line is: $chewed_line\n"; - local($temp_file)=`mktemp "$TMP/zz_frdsumdir.XXXXXX"`; chop($temp_file); @@ -64,8 +61,6 @@ system("ls -HhlF $color_add $chewed_line > $temp_file"); # the color_add variable, if defined, will have flags for setting the # directory listing color scheme. -##print "file is: $temp_file\n"; - local($lengths) = 0; # open the file and process the lines to get file lengths. @@ -75,7 +70,6 @@ $pattern="^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +([0-9.]+[KMG]?).*\$"; foreach $file_line () { if ($file_line =~ /$pattern/) { (local $munged = $file_line) =~ s/$pattern/\1/; - #print "munge=$munged\n"; if ($munged =~ /K$/) { chop $munged; $munged *= 1024.0; @@ -97,8 +91,6 @@ foreach $file_line () { close(DIRLIST); unlink($temp_file); # clean up. -#print "lens are: $lengths\n"; - local($total)=int($lengths); local($kbytes)=int($total / 102.4) / 10; local($mbytes)=int($kbytes / 102.4) / 10;