summaryrefslogtreecommitdiff
path: root/postfix
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-07-06 13:41:52 +0200
committerJonas Smedegaard <dr@jones.dk>2014-07-06 13:42:48 +0200
commit2527b269308e3dedc033550ef4de8d377c3ef721 (patch)
tree879ecb5cf15fc706341ba86cbc8fdb35af7f911f /postfix
parentd87f3112d09a88ae6c47bc732d7c58f518b29aaa (diff)
Fix getperlvarfromfile() to use defaultvar when var is empty.
Diffstat (limited to 'postfix')
-rwxr-xr-xpostfix/postfix.sh2
1 files changed, 1 insertions, 1 deletions
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() {