1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(ange-ftp-file-size): Use unwind-protect.

This commit is contained in:
Stefan Monnier 2009-10-18 00:46:49 +00:00
parent 18b5ffb503
commit 2b93080a46
2 changed files with 9 additions and 4 deletions

View file

@ -3570,10 +3570,11 @@ so return the size on the remote host exactly. See RFC 3659."
;; Transfer complete" before the "213 SIZE". Let's skip
;; that.
(ange-ftp-skip-msgs (concat ange-ftp-skip-msgs "\\|^226"))
(res (prog2
(unless ascii-mode
(ange-ftp-set-binary-mode host user))
(ange-ftp-send-cmd host user (list 'quote "size" name))
(res (unwind-protect
(progn
(unless ascii-mode
(ange-ftp-set-binary-mode host user))
(ange-ftp-send-cmd host user (list 'quote "size" name)))
(unless ascii-mode
(ange-ftp-set-ascii-mode host user))))
(line (cdr res)))