]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#28435: "all" score file is ignored
authorSam Steingold <sds@gnu.org>
Mon, 18 Sep 2017 20:33:37 +0000 (16:33 -0400)
committerSam Steingold <sds@gnu.org>
Mon, 18 Sep 2017 20:33:37 +0000 (16:33 -0400)
(gnus-score-find-bnews): Fix removing the empty suffix.

lisp/gnus/gnus-score.el

index 11a45dda9ad4f3999a4639231cedabfea1885317..976ac9f7f3534c75f8e0b5768663e6ebb03f3cb6 100644 (file)
@@ -2731,8 +2731,10 @@ GROUP using BNews sys file syntax."
        (insert (car sfiles))
        (goto-char (point-min))
        ;; First remove the suffix itself.
-       (when (re-search-forward (concat "." score-regexp) nil t)
-         (replace-match "" t t)
+       (when (re-search-forward score-regexp nil t)
+          (unless (= (match-end 0) (match-beginning 0)) ; non-empty suffix
+            (replace-match "" t t)
+            (delete-char -1))   ; remove the "." before the suffix
          (goto-char (point-min))
          (if (looking-at (regexp-quote kill-dir))
              ;; If the file name was just "SCORE", `klen' is one character