Mercurial > emacs
changeset 43187:992a5c499b47
(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.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 08 Feb 2002 12:37:02 +0000 |
parents | 4725c09ff437 |
children | 55a2fa4336d2 |
files | lisp/net/ange-ftp.el |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/net/ange-ftp.el Fri Feb 08 12:32:18 2002 +0000 +++ b/lisp/net/ange-ftp.el Fri Feb 08 12:37:02 2002 +0000 @@ -1598,10 +1598,10 @@ 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) @@ -1633,7 +1633,11 @@ (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."