bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22333: 24.5; EWW downloads invalid compressed tar-files


From: Lars Ingebrigtsen
Subject: bug#22333: 24.5; EWW downloads invalid compressed tar-files
Date: Thu, 04 Feb 2016 15:59:12 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux)

Iñigo Serna <address@hidden> writes:

> `eww-download-callback` (called by `url-retrieve`) should remove those 
> headers 
> after download is finished and before buffer is saved to disk.
>
> A simple fix could be to add (excuse my poor elisp skills):
>
>     (goto-char (point-min))
>     (search-forward-regexp "^$")
>     (forward-line)
>     (delete-region (point-min) (point))
>
> before '(write-file file)' in `eww-download-callback`.

This function looks like this in emacs-25:

(defun eww-download-callback (status url)
  (unless (plist-get status :error)
    (let* ((obj (url-generic-parse-url url))
           (path (car (url-path-and-query obj)))
           (file (eww-make-unique-file-name
                  (eww-decode-url-file-name (file-name-nondirectory path))
                  eww-download-directory)))
      (goto-char (point-min))
      (re-search-forward "\r?\n\r?\n")
      (write-region (point) (point-max) file)
      (message "Saved %s" file))))

So it looks like this has already been fixed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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