Control: tags -1 + patch
[Sebastien Delafond]
> battery-log isn't empty, as shown by cat'ing the temporary file created
> by the battery-graph run above:
Thank you for the bug report. I've had a close look, and the problem
happen when the log do not show any discharge period (ie the
TIME_LAST_DISCHARGE_BEGIN variable is empty).
This patch improve fix the issue:
diff --git a/src/battery-graph.in b/src/battery-graph.in
index bb5cb62..4b97d5f 100644
--- a/src/battery-graph.in
+++ b/src/battery-graph.in
@@ -172,7 +172,7 @@ TIME_LAST_DISCHARGE_BEGIN=`awk "BEGIN {last_status=-1} \
{ if (\\\$3!=last_status && \\\$3==1) {tchange = \\\$1} last_status=\\\$3 } \
END {print (tchange)}" $TMPFILENAME`
-if [ ! "$TIME_LAST_RECORD" ] ; then
+if [ ! "$TIME_LAST_DISCHARGE_BEGIN" ] ; then
SWITCH_RATE=false
else
TIME_LAST_DISCHARGE_END=`awk "BEGIN {last_status=-1} \
--
Happy hacking
Petter Reinholdtsen