From: Juri Linkov Date: Sun, 20 Mar 2005 20:59:52 +0000 (+0000) Subject: (progress-reporter-do-update): When `min-value' is equal X-Git-Tag: ttn-vms-21-2-B4~1675 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe6b1dbdc696ab68c8bd88b6e1276d7a7d4220ca;p=emacs.git (progress-reporter-do-update): When `min-value' is equal to `max-value', set `percentage' to 0 and prevent division by zero. --- 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 + + * 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 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