summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog9
-rw-r--r--lisp/gnus/nnheader.el20
2 files changed, 24 insertions, 5 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index beccd918c3e..750956b9f8b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,12 @@
+2006-07-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnheader.el (nnheader-insert-head): Make it work with Mac as well.
+
+2006-07-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnheader.el (nnheader-insert-head): Make it work even if the file
+ uses CRLF for the line-break code.
+
2006-07-19 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
* mm-url.el (mm-url-insert-file-contents): Inhibit Connection: close
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index d564d42414e..79732cd3d88 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -586,17 +586,27 @@ the line could be found."
(if (eq nnheader-max-head-length t)
;; Just read the entire file.
(nnheader-insert-file-contents file)
- ;; Read 1K blocks until we find a separator.
+ ;; Read blocks of the size specified by `nnheader-head-chop-length'
+ ;; until we find a separator.
(let ((beg 0)
- format-alist)
+ (start (point))
+ ;; Use `binary' to prevent the contents from being decoded,
+ ;; or it will change the number of characters that
+ ;; `insert-file-contents' returns.
+ (coding-system-for-read 'binary))
(while (and (eq nnheader-head-chop-length
- (nth 1 (nnheader-insert-file-contents
+ (nth 1 (mm-insert-file-contents
file nil beg
(incf beg nnheader-head-chop-length))))
- (prog1 (not (search-forward "\n\n" nil t))
+ ;; CRLF of CR might be used for the line-break code.
+ (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t))
(goto-char (point-max)))
(or (null nnheader-max-head-length)
- (< beg nnheader-max-head-length))))))
+ (< beg nnheader-max-head-length))))
+ ;; Finally decode the contents.
+ (when (mm-coding-system-p nnheader-file-coding-system)
+ (mm-decode-coding-region start (point-max)
+ nnheader-file-coding-system))))
t))
(defun nnheader-article-p ()