From 84f089d3fb26708efdab41f823e65af718bb6cf8 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Sun, 9 Mar 2008 20:16:12 +0000 Subject: [PATCH] (url-http-chunked-encoding-after-change-function): Remove superfluous CRLF at end of file. (bug #42) --- lisp/url/ChangeLog | 5 +++++ lisp/url/url-http.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 69f5a5c295a..531dce8e728 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2008-03-09 Magnus Henoch + + * url-http.el (url-http-chunked-encoding-after-change-function): + Remove superfluous CRLF at end of file. (bug #42) + 2008-03-02 Andreas Schwab * url-util.el: Require cl when compiling. diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 7b29eba05ef..c9cecea65c1 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -948,7 +948,11 @@ the end of the document." (url-http-debug "Saw end of stream chunk!") (setq read-next-chunk nil) (url-display-percentage nil nil) - (goto-char (match-end 1)) + ;; Every chunk, even the last 0-length one, is + ;; terminated by CRLF. Skip it. + (when (looking-at "\r?\n") + (url-http-debug "Removing terminator of last chunk") + (delete-region (match-beginning 0) (match-end 0))) (if (re-search-forward "^\r*$" nil t) (url-http-debug "Saw end of trailers...")) (if (url-http-parse-headers) -- 2.39.2