changeset 78544:4af36cf4d2db

(vhdl-update-progress-info): Avoid divide by zero error.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 13 Aug 2007 11:39:45 +0000
parents 4e51ba479b3c
children c8072938bf22
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:38:37 2007 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Mon Aug 13 11:39:45 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)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;