Merge remote branch 'origin/no-gnus'
[gnus] / lisp / gnus-start.el
index 53ae6e1..4a833e0 100644 (file)
@@ -2299,6 +2299,13 @@ If FORCE is non-nil, the .newsrc file is read."
 
 (defun gnus-clean-old-newsrc (&optional force)
   (when gnus-newsrc-file-version
+    ;; Remove totally bogus `unexists' entries.  The name is
+    ;; `unexist'.
+    (dolist (info (cdr gnus-newsrc-alist))
+      (let ((exist (assoc 'unexists (gnus-info-marks info))))
+       (when exist
+         (gnus-info-set-marks
+          info (delete exist (gnus-info-marks info))))))
     (when (or force
              (< (gnus-continuum-version gnus-newsrc-file-version)
                 (gnus-continuum-version "Ma Gnus v0.03")))
@@ -2446,7 +2453,9 @@ If FORCE is non-nil, the .newsrc file is read."
        (when gnus-newsrc-assoc
          (setq gnus-newsrc-alist gnus-newsrc-assoc))))
     (dolist (elem gnus-newsrc-alist)
-      (setcar elem (mm-string-as-unibyte (car elem))))
+      ;; Protect against broken .newsrc.el files.
+      (when (car elem)
+       (setcar elem (mm-string-as-unibyte (car elem)))))
     (gnus-make-hashtable-from-newsrc-alist)
     (when (file-newer-than-file-p file ding-file)
       ;; Old format quick file