From 6a73c7eeb1ae5f0d1d798b43cd3a62a03c916b66 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 14 Jun 2018 11:44:14 +0930 Subject: [PATCH] configure: fix defaults in help. Both "[ 1 ]" and "[ 0 ]" both evaluate true in shell; we really want an explicit '1' test. Before: $ ./configure --help ... --enable/disable-compat (default disable) After: $ ./configure --help ... --enable/disable-compat (default enable) Signed-off-by: Rusty Russell --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 8ac2a7333..5970b4850 100755 --- a/configure +++ b/configure @@ -19,10 +19,10 @@ CONFIG_HEADER=ccan/config.h usage_with_default() { if [ $# = 4 ]; then - if [ $2 ]; then - DEF=$4 - else + if [ "$2" = 1 ]; then DEF=$3 + else + DEF=$4 fi else DEF=$2