changeset 73599:65d9fbabd719

* battery.el (battery-linux-proc-acpi): Prevent range error when `full-capacity' is 0.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 01 Nov 2006 14:24:37 +0000
parents a2e7a4d48fea
children fe1f7fc1d1d6
files lisp/ChangeLog lisp/battery.el
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 31 21:49:55 2006 +0000
+++ b/lisp/ChangeLog	Wed Nov 01 14:24:37 2006 +0000
@@ -1,3 +1,8 @@
+2006-10-31  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+	* battery.el (battery-linux-proc-acpi): Prevent range error when
+	`full-capacity' is 0.
+
 2006-10-31 Yoni Rabkin Katzenell <yoni-r@actcom.com>  (tiny change)
 
 	* lisp/faces.el (faces-sample-overlay): New defvar.
--- a/lisp/battery.el	Tue Oct 31 21:49:55 2006 +0000
+++ b/lisp/battery.el	Wed Nov 01 14:24:37 2006 +0000
@@ -408,6 +408,7 @@
 			    (format "%d:%02d" hours (- minutes (* 60 hours))))
 		       "N/A"))
 	  (cons ?p (or (and full-capacity capacity
+			    (> full-capacity 0)
 			    (number-to-string
 			     (floor (/ capacity
 				       (/ (float full-capacity) 100)))))