summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2005-03-20 20:59:52 +0000
committerJuri Linkov <juri@jurta.org>2005-03-20 20:59:52 +0000
commitfe6b1dbdc696ab68c8bd88b6e1276d7a7d4220ca (patch)
tree9f266afed51e29cbaa8f101235ced08294d66eb7 /lisp
parent340b8d4f63cd3d20a3c1883b78111e3768c0265b (diff)
downloademacs-fe6b1dbdc696ab68c8bd88b6e1276d7a7d4220ca.tar.gz
(progress-reporter-do-update): When `min-value' is equal
to `max-value', set `percentage' to 0 and prevent division by zero.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/subr.el4
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d1a050343ec..f9cad483232 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-20 Juri Linkov <juri@jurta.org>
+
+ * subr.el (progress-reporter-do-update): When `min-value' is equal
+ to `max-value', set `percentage' to 0 and prevent division by zero.
+
2005-03-20 Michael Albinus <michael.albinus@gmx.de>
Sync with Tramp 2.0.48.
diff --git a/lisp/subr.el b/lisp/subr.el
index b9e7786cfe4..4ff9be7e8b9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2750,7 +2750,9 @@ change the displayed message."
(min-value (aref parameters 1))
(max-value (aref parameters 2))
(one-percent (/ (- max-value min-value) 100.0))
- (percentage (truncate (/ (- value min-value) one-percent)))
+ (percentage (if (= max-value min-value)
+ 0
+ (truncate (/ (- value min-value) one-percent))))
(update-time (aref parameters 0))
(current-time (float-time))
(enough-time-passed