(spam-check-ifile): fixed call-process-region to use the
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 9 Jan 2003 20:14:59 +0000 (20:14 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 9 Jan 2003 20:14:59 +0000 (20:14 +0000)
db parameter only if it's set

lisp/ChangeLog
lisp/spam.el

index 478014a..9b085a0 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-09  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-check-ifile): fixed call-process-region to use the
+       db parameter only if it's set
+
 2002-01-09  Kevin Greiner  <kgreiner@xpediantsolutions.com>
 
        * gnus-agent.el (gnus-agent-catchup): Do not mark cached nor
index 6e4c3de..aaa69da 100644 (file)
@@ -556,19 +556,22 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
   "Get the command-line parameter for ifile's database from spam-ifile-database-path."
   (if spam-ifile-database-path
       (format "--db-file=%s" spam-ifile-database-path)
-    ""))
+    nil))
     
 (defun spam-check-ifile ()
   "Check the ifile backend for the classification of this message"
   (let ((article-buffer-name (buffer-name)) 
        category return)
     (with-temp-buffer
-      (let ((temp-buffer-name (buffer-name)))
+      (let ((temp-buffer-name (buffer-name))
+           (db-param (spam-get-ifile-database-parameter)))
        (save-excursion
          (set-buffer article-buffer-name)
-         (call-process-region (point-min) (point-max) spam-ifile-path 
-                              nil temp-buffer-name nil 
-                              "-q" "-c" (spam-get-ifile-database-parameter)))
+         (if db-param
+             (call-process-region (point-min) (point-max) spam-ifile-path
+                                  nil temp-buffer-name nil "-q" "-c" db-param)
+           (call-process-region (point-min) (point-max) spam-ifile-path
+                                nil temp-buffer-name nil "-q" "-c")))
        (goto-char (point-min))
        (if (not (eobp))
            (setq category (buffer-substring (point) (spam-point-at-eol))))
@@ -578,7 +581,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
            ;; else, if spam-ifile-all-categories is not set...
            (when (string-equal spam-ifile-spam-category category)
              ;; always accept the ifile category
-             (setq return spam-split-group))))))       
+             (setq return spam-split-group))))))
     return))
 
 (defun spam-ifile-register-with-ifile (article-string category)