emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0bddbbc: Fix bug#28435: "all" score file is ignored


From: Sam Steingold
Subject: [Emacs-diffs] master 0bddbbc: Fix bug#28435: "all" score file is ignored
Date: Mon, 18 Sep 2017 16:33:55 -0400 (EDT)

branch: master
commit 0bddbbc5aae621d5875880ac3e63f68d481df7c3
Author: Sam Steingold <address@hidden>
Commit: Sam Steingold <address@hidden>

    Fix bug#28435: "all" score file is ignored
    
    (gnus-score-find-bnews): Fix removing the empty suffix.
---
 lisp/gnus/gnus-score.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 11a45dd..976ac9f 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]