(spam-stat-test-directory): Skip 0 length files.
authorAlex Schroeder <alex@gnu.org>
Thu, 1 May 2003 14:08:21 +0000 (14:08 +0000)
committerAlex Schroeder <alex@gnu.org>
Thu, 1 May 2003 14:08:21 +0000 (14:08 +0000)
lisp/spam-stat.el

index 4c9093f..66d4ff3 100644 (file)
@@ -504,7 +504,8 @@ check the variable `spam-stat-score-data'."
     (with-temp-buffer
       (dolist (f files)
        (when (and (file-readable-p f)
-                  (file-regular-p f))
+                  (file-regular-p f)
+                   (> (nth 7 (file-attributes f)) 0))
          (setq count (1+ count))
          (message "Reading %s: %.2f%%" dir (/ count max))
          (insert-file-contents f)
@@ -540,7 +541,8 @@ You can use this to determine error rates."
     (with-temp-buffer
       (dolist (f files)
        (when (and (file-readable-p f)
-                  (file-regular-p f))
+                  (file-regular-p f)
+                   (> (nth 7 (file-attributes f))))
          (setq count (1+ count))
          (message "Reading %.2f%%, score %.2f%%"
                   (/ count max) (/ score count))