[xiph-commits] r9080 - trunk/mgm/modules/linux

xiphmont at motherfish-iii.xiph.org xiphmont at motherfish-iii.xiph.org
Wed Mar 16 21:12:25 PST 2005


Author: xiphmont
Date: 2005-03-16 21:12:24 -0800 (Wed, 16 Mar 2005)
New Revision: 9080

Modified:
   trunk/mgm/modules/linux/battery
Log:
Fix a regexp that was reading incorrect battery values



Modified: trunk/mgm/modules/linux/battery
===================================================================
--- trunk/mgm/modules/linux/battery	2005-03-17 01:25:28 UTC (rev 9079)
+++ trunk/mgm/modules/linux/battery	2005-03-17 05:12:24 UTC (rev 9080)
@@ -358,7 +358,7 @@
 		$battstatus[$batteries]=-1;
 		$percent[$batteries]=0;
 		while(<PROC>){
-		    if(m/^last full capacity:\s+(\d)/){
+		    if(m/^last full capacity:\s+(\d+)/){
 			$total=$1;
 		    }
 		    if(m/^present:\s+yes/){
@@ -367,7 +367,7 @@
 		}
 		
 		while(<PROC2>){
-		    if(m/^remaining capacity:\s+(\d)/){
+		    if(m/^remaining capacity:\s+(\d+)/){
 			$percent[$batteries]=$1*100/$total;
 		    }
 		    if(m/^charging state:\s+charging/){
@@ -383,8 +383,6 @@
 		close PROC2;
 	    }
 	    close PROC;
-	    
-	    
 	    $batteries++;
 	}
 	



More information about the commits mailing list