From: Eli Zaretskii Date: Fri, 8 Feb 2002 12:50:23 +0000 (+0000) Subject: (ange-ftp-process-handle-line, ange-ftp-set-xfer-size): If the file's X-Git-Tag: emacs-21.2~100 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cfd8fcb10c7dfd917ac5e4ce361c81f5f55d87c2;p=emacs.git (ange-ftp-process-handle-line, ange-ftp-set-xfer-size): If the file's size is a float, divide by 1024 instead of using ash. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa84ac967f6..d2afe69dc17 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2002-02-08 Eli Zaretskii + + * net/ange-ftp.el (ange-ftp-process-handle-line) + (ange-ftp-set-xfer-size): If the file's size is a float, divide + by 1024 instead of using ash. + 2002-02-07 ShengHuo ZHU * mail/rmail.el (rmail-enable-mime-composing): New. A lightweight diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 06a34f58ea8..774db5d7630 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1528,10 +1528,10 @@ Try to categorize it into one of four categories: good, skip, fatal, or unknown." (cond ((string-match ange-ftp-xfer-size-msgs line) (setq ange-ftp-xfer-size - (ash (string-to-int (substring line - (match-beginning 1) - (match-end 1))) - -10))) + (/ (string-to-number (substring line + (match-beginning 1) + (match-end 1))) + 1024))) ((string-match ange-ftp-skip-msgs line) t) ((string-match ange-ftp-good-msgs line) @@ -1563,7 +1563,11 @@ good, skip, fatal, or unknown." (if buf (save-excursion (set-buffer buf) - (setq ange-ftp-xfer-size (ash bytes -10)))))))) + (setq ange-ftp-xfer-size + ;; For very large files, BYTES can be a float. + (if (integerp bytes) + (ash bytes -10) + (/ bytes 1024))))))))) (defun ange-ftp-process-handle-hash (str) "Remove hash marks from STRING and display count so far."