From 9d7fee1c1978abfeacc86652abdb9de6e0a2a0c4 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 19 Mar 2010 13:08:18 +0100 Subject: [PATCH] Use -z and -n in printconf instead of == "" and != "" This could prevent potential problems when (default) values contain values special to [, such as -n or -a etc. It seems bash is smart enough to detect this, but better be safe than sorry. --- lib/tools.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tools.in b/lib/tools.in index 9879e74..eeec590 100644 --- a/lib/tools.in +++ b/lib/tools.in @@ -34,7 +34,7 @@ function printconf() { local CURRENT_PARAM=$1 local ret=`@AWK@ -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE` # if nothing is returned, set the default - if [ "$ret" == "" -a "$2" != "" ]; then + if [ -z "$ret" -a -n "$2" ]; then ret="$2" fi -- 2.30.2