small tweak to double check that only valid temp data gets used in regex

This commit is contained in:
inxi-svn 2009-07-30 01:00:24 +00:00
parent 1452797265
commit f410dc896c

2
inxi
View file

@ -3095,7 +3095,7 @@ get_sensors_data()
# final fallback if all else fails, funtoo user showed sensors putting # final fallback if all else fails, funtoo user showed sensors putting
# temp on wrapped second line, not handled # temp on wrapped second line, not handled
/^(core0|core 0)(.*)\+([0-9]+)(.*)[ \t°](C|F)/ { /^(core0|core 0)(.*)\+([0-9]+)(.*)[ \t°](C|F)/ && $2 ~ /^[ \t]*\+([0-9]+)/ {
tempWorking=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 ) tempWorking=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 )
if ( core0Temp == "" || tempWorking > 0 ) { if ( core0Temp == "" || tempWorking > 0 ) {
core0Temp=tempWorking core0Temp=tempWorking