(gnus-configure-posting-styles): Don't cause the "Args out of range" error.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Sun, 7 Nov 2004 23:56:10 +0000 (23:56 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Sun, 7 Nov 2004 23:56:10 +0000 (23:56 +0000)
lisp/ChangeLog
lisp/gnus-msg.el

index be44ad2..1fb1f52 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-msg.el (gnus-configure-posting-styles): Don't cause the
+       "Args out of range" error.  Reported by Arnaud Giersch
+       <arnaud.giersch@free.fr>.
+
 2004-11-07  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-sum.el (gnus-summary-clear-local-variables): Use symbolp.
 2004-11-07  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-sum.el (gnus-summary-clear-local-variables): Use symbolp.
index 518cff2..5087e65 100644 (file)
@@ -1871,11 +1871,13 @@ this is a reply."
            (when (and filep v)
              (setq v (with-temp-buffer
                        (insert-file-contents v)
            (when (and filep v)
              (setq v (with-temp-buffer
                        (insert-file-contents v)
-                       (goto-char (point-max))
-                       (skip-chars-backward "\n")
-                       (delete-region (+ (point) (if (bolp) 0 1))
-                                      (point-max))
-                       (buffer-string))))
+                       (buffer-substring
+                        (point-min)
+                        (progn
+                          (goto-char (point-max))
+                          (if (zerop (skip-chars-backward "\n"))
+                              (point)
+                            (1+ (point))))))))
            (setq results (delq (assoc element results) results))
            (push (cons element v) results))))
       ;; Now we have all the styles, so we insert them.
            (setq results (delq (assoc element results) results))
            (push (cons element v) results))))
       ;; Now we have all the styles, so we insert them.