digest: Fix incorrect statistics when hashes fail
authorcvs <cvs@a5e33b96-951a-0410-ae88-c0fe16d076bb>
Mon, 5 May 2003 04:20:14 +0000 (04:20 +0000)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Sat, 9 Jan 2010 02:17:28 +0000 (21:17 -0500)
An order-of-operations bug can lead to files being counted as hashed
when they are not (e.g. due to I/O error or the file disappearing).
Calculate the digest, then increment the statistics.

git-svn-id: svn+ssh://svn.furryterror.org/r/trunk/mokona/zblaxell@3332 a5e33b96-951a-0410-ae88-c0fe16d076bb

faster-dupemerge

index a007540b3ace88bd5ba7009b3b4c7d6e66d163c3..b7554dee59e78b32f89b88772db070ea58e2321f 100755 (executable)
@@ -90,9 +90,10 @@ sub digest {
        if ($skip_hashes) {
                return "SKIPPING HASHES";
        } else {
-               &really_digest($filename);
+               my $digest = &really_digest($filename);
                $hash_bytes += -s $filename;
                $hash_files++;
+               return $digest
        }
 }