changeset 82363:f0b6bf720515

(vhdl-update-progress-info): Avoid divide by zero error.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 13 Aug 2007 11:12:50 +0000
parents 8d7512ea727b
children 0c34fdde692c
files lisp/progmodes/vhdl-mode.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/vhdl-mode.el	Mon Aug 13 11:10:47 2007 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Mon Aug 13 11:12:50 2007 +0000
@@ -6982,10 +6982,13 @@
   (when (and vhdl-progress-info (not noninteractive)
 	     (< vhdl-progress-interval
 		(- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
-    (message (concat string "... (%2d%s)")
-	     (/ (* 100 (- pos (aref vhdl-progress-info 0)))
-		(- (aref vhdl-progress-info 1)
-		   (aref vhdl-progress-info 0))) "%")
+    (let ((delta (- (aref vhdl-progress-info 1)
+                    (aref vhdl-progress-info 0))))
+      (if (= 0 delta)
+          (message (concat string "... (100%s)") "%")
+        (message (concat string "... (%2d%s)")
+                 (/ (* 100 (- pos (aref vhdl-progress-info 0)))
+                    delta) "%")))
     (aset vhdl-progress-info 2 (nth 1 (current-time)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;