From 031b0a3936898a64976ba06fb2c8bb242fac046e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 28 Feb 2009 18:22:15 +0100 Subject: debug fix in check_is_in --- src/core/libs/lib-misc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/libs/lib-misc.sh') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 6f7af95..d0ad3f0 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -51,15 +51,17 @@ wait_for () check_is_in () { [ -z "$1" ] && debug 'MISC' "check_is_in $1 $2" && die_error "check_is_in needs a non-empty needle as \$1 and a haystack as \$2!" # haystack can be empty though + NEEDLE=$1 + HAYSTACK=$2 - local pattern="$1" element + local pattern="$NEEDLE" element shift for element do [[ $element = $pattern ]] && debug 'MISC' "Checking if $element = $pattern ..yes !" && return 0 debug 'MISC' "Checking if $element = $pattern ... no" done - debug 'MISC' "Check_is_in could not find $1 in $2" + debug 'MISC' "Check_is_in could not find $NEEDLE in $HAYSTACK" return 1 } -- cgit v1.2.3-54-g00ecf