Fix battery charging status
commit8d24e278fa0ec4901275ff9c43a43ee948bde9a5
authorCarlos R. Mafra <crmafra@gmail.com>
Thu, 5 May 2011 08:19:52 +0000 (5 10:19 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Thu, 5 May 2011 08:26:29 +0000 (5 10:26 +0200)
tree811147aec3610068b87dd28bb7f9fd5aa78ffe26
parentfddbe08d91a1d075056e145d9563b478660d1cb4
Fix battery charging status

The 'charging' status was being set to 'false' even when the battery
was in fact charging.

Move the 'false' assigment out of the while() loop to avoid overwriting
the 'true' value in the next loop iteraction -- as might happen if the loop
reads an "invalid" dir inside /sys/class/power_supply/ after correctly
setting the charging status.
src/battery.c