From 5504af2259e65265adad2e4f44925f9ba5ecbc13 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Feb 2002 12:37:02 +0000 Subject: [PATCH] (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. --- lisp/net/ange-ftp.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1cb56f9ad7a..7e4daa2c735 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1598,10 +1598,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) @@ -1633,7 +1633,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." -- 2.39.5