]> git.eshelyaron.com Git - emacs.git/commitdiff
(url-http-chunked-encoding-after-change-function):
authorChong Yidong <cyd@stupidchicken.com>
Sat, 5 Apr 2008 00:49:01 +0000 (00:49 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 5 Apr 2008 00:49:01 +0000 (00:49 +0000)
Remove superfluous CRLF at end of file.  (bug #42)

lisp/url/url-http.el

index 955eac0f99565a986d300db0cd1f59d99cb830ec..98060461f3d0fcc6a5896809d7404e7455327561 100644 (file)
@@ -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)