diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-03-10 22:09:16 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-03-10 22:09:16 +0100 |
commit | 293588673428d5e3c08d30b5a1a3b6246a5bec3a (patch) | |
tree | e310d8f0baf3756cb8f7e6158f99567ed5976030 | |
parent | 41d474469a3327a7625a320af9871b0160026b36 (diff) |
fix segfault caused by loop
-rw-r--r-- | src/core/libs/lib-misc.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index ef7a000..c30e4cb 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -50,7 +50,7 @@ wait_for () # $2 set (array) haystack 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 + [ -z "$1" ] && die_error "check_is_in needs a non-empty needle as \$1 and a haystack as \$2!(got: check_is_in '$1' '$2'" # haystack can be empty though NEEDLE=$1 HAYSTACK=$2 @@ -58,10 +58,8 @@ check_is_in () shift for element do - [[ $element = $pattern ]] && debug 'MISC' "Checking if $element = $pattern ..yes !" && return 0 - debug 'MISC' "Checking if $element = $pattern ... no" + [[ $element = $pattern ]] && return 0 done - debug 'MISC' "Check_is_in could not find $NEEDLE in $HAYSTACK" return 1 } |