]> git.eshelyaron.com Git - emacs.git/commitdiff
* battery.el (battery-linux-proc-acpi): Prevent range error when
authorChong Yidong <cyd@stupidchicken.com>
Wed, 1 Nov 2006 14:24:37 +0000 (14:24 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 1 Nov 2006 14:24:37 +0000 (14:24 +0000)
`full-capacity' is 0.

lisp/ChangeLog
lisp/battery.el

index 83c082df439a9b895d92c37f111da04eabc32d4b..85adffd97c3b927e4190a0611806235909668007 100644 (file)
@@ -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.
index 50edc8dde8ae4c4f7561cd3e7cfc8b44f1abeb3b..ec35e04e1aba7261f2c6e1d6400cde4f2288aa4a 100644 (file)
@@ -408,6 +408,7 @@ The following %-sequences are provided:
                            (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)))))