summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2005-03-20 20:59:14 +0000
committerJuri Linkov <juri@jurta.org>2005-03-20 20:59:14 +0000
commit5ffe6213042f83f8cd79b218728696fca2d0e2e3 (patch)
treed13a4d8508fd1a2f8c72d83ce343fd3449eece10
parenta5fb9f81a031ce5857b9c66802ea602f943da2bf (diff)
downloademacs-5ffe6213042f83f8cd79b218728696fca2d0e2e3.tar.gz
(progress-reporter-do-update): When `min-value' is equal
to `max-value', set `percentage' to 0 and prevent division by zero.
-rw-r--r--lisp/subr.el4
1 files changed, 3 insertions, 1 deletions
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