]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-file-size): Use unwind-protect.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 18 Oct 2009 00:46:49 +0000 (00:46 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 18 Oct 2009 00:46:49 +0000 (00:46 +0000)
lisp/ChangeLog
lisp/net/ange-ftp.el

index 959b20b9273d107dc5a182e9ba44f0185d6a3b71..f6eaf0ff04f81a68b846a9fe6f1506033dafa5c9 100644 (file)
@@ -1,3 +1,7 @@
+2009-10-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * net/ange-ftp.el (ange-ftp-file-size): Use unwind-protect.
+
 2009-10-18  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (compile-last): Ensure GREP_OPTIONS is null before calling
index 6f1958821b871ee373e9522970ad04fcfc7296ac..38b1646f452a31da93e8b3e56e80e0f6edb43c54 100644 (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)))