diff options
author | Juri Linkov <juri@jurta.org> | 2005-03-20 20:59:14 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2005-03-20 20:59:14 +0000 |
commit | 5ffe6213042f83f8cd79b218728696fca2d0e2e3 (patch) | |
tree | d13a4d8508fd1a2f8c72d83ce343fd3449eece10 | |
parent | a5fb9f81a031ce5857b9c66802ea602f943da2bf (diff) | |
download | emacs-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.el | 4 |
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 |