aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2002-02-08 12:37:02 +0000
committerEli Zaretskii2002-02-08 12:37:02 +0000
commit5504af2259e65265adad2e4f44925f9ba5ecbc13 (patch)
tree1bf196da83b14c4ef7bd611ad4d9a48d7cfbb07f
parentcd01f5b91c5ca85d6ee10f1093e43077219190a1 (diff)
downloademacs-5504af2259e65265adad2e4f44925f9ba5ecbc13.tar.gz
emacs-5504af2259e65265adad2e4f44925f9ba5ecbc13.zip
(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.
-rw-r--r--lisp/net/ange-ftp.el14
1 files 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:
1598good, skip, fatal, or unknown." 1598good, skip, fatal, or unknown."
1599 (cond ((string-match ange-ftp-xfer-size-msgs line) 1599 (cond ((string-match ange-ftp-xfer-size-msgs line)
1600 (setq ange-ftp-xfer-size 1600 (setq ange-ftp-xfer-size
1601 (ash (string-to-int (substring line 1601 (/ (string-to-number (substring line
1602 (match-beginning 1) 1602 (match-beginning 1)
1603 (match-end 1))) 1603 (match-end 1)))
1604 -10))) 1604 1024)))
1605 ((string-match ange-ftp-skip-msgs line) 1605 ((string-match ange-ftp-skip-msgs line)
1606 t) 1606 t)
1607 ((string-match ange-ftp-good-msgs line) 1607 ((string-match ange-ftp-good-msgs line)
@@ -1633,7 +1633,11 @@ good, skip, fatal, or unknown."
1633 (if buf 1633 (if buf
1634 (save-excursion 1634 (save-excursion
1635 (set-buffer buf) 1635 (set-buffer buf)
1636 (setq ange-ftp-xfer-size (ash bytes -10)))))))) 1636 (setq ange-ftp-xfer-size
1637 ;; For very large files, BYTES can be a float.
1638 (if (integerp bytes)
1639 (ash bytes -10)
1640 (/ bytes 1024)))))))))
1637 1641
1638(defun ange-ftp-process-handle-hash (str) 1642(defun ange-ftp-process-handle-hash (str)
1639 "Remove hash marks from STRING and display count so far." 1643 "Remove hash marks from STRING and display count so far."