From e6c94c66ed2fbb02b8a347f694f0e61813b6d9a1 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 8 Jan 2008 20:10:52 +0000 Subject: [PATCH] Bash doesn't do lazy evaluation on test-like expressions, so don't assume it does (#2292). git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5100 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/pwm/pwmconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 1f6a37d6..c5dfca47 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -115,9 +115,12 @@ function is_pwm_auto() if [ -n "$SYSFS" ] then ENABLE=${1}_enable - if [ -f $ENABLE -a "`cat $ENABLE`" -gt 1 ] + if [ -f $ENABLE ] then - return 0 + if [ "`cat $ENABLE`" -gt 1 ] + then + return 0 + fi fi fi