From 2527b269308e3dedc033550ef4de8d377c3ef721 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 6 Jul 2014 13:41:52 +0200 Subject: Fix getperlvarfromfile() to use defaultvar when var is empty. --- postfix/postfix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'postfix/postfix.sh') diff --git a/postfix/postfix.sh b/postfix/postfix.sh index beed3af..9cceaf3 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -181,7 +181,7 @@ getperlvarfromfile() { file="$3" context="${4:-postfix}" catfirstfile "$file" "$context" \ - | perl -nE'/^\$$ENV{"var"}\h*=\h*(\d+)/ and $s=$1; END {print ($s) ? $s : $ENV{'default'}}' + | perl -nE'/^\$$ENV{"var"}\h*=\h*(\d+)/ and $s=$1; END {print length($s) ? $s : $ENV{'default'}}' } getlinesfromfile() { -- cgit v1.2.3