diff --git a/qb/qb.libs.sh b/qb/qb.libs.sh index b142776e5b..19a779cfa5 100644 --- a/qb/qb.libs.sh +++ b/qb/qb.libs.sh @@ -16,7 +16,7 @@ add_define() # $@ = include or library paths add_dirs() { ADD="$1"; LINK="${1%"${1#?}"}"; shift - while [ "$1" ]; do + while [ $# -gt 0 ]; do eval "${ADD}_DIRS=\"\${${ADD}_DIRS} -${LINK}${1}\"" shift done @@ -292,7 +292,7 @@ create_config_header() { printf %s\\n "#ifndef $name" "#define $name" '' \ "#define PACKAGE_NAME \"$PACKAGE_NAME\"" - while [ "$1" ]; do + while [ $# -gt 0 ]; do case "$(eval "printf %s \"\$HAVE_$1\"")" in 'yes') n='0' @@ -361,7 +361,7 @@ create_config_make() "BUILD = $BUILD" \ "PREFIX = $PREFIX" - while [ "$1" ]; do + while [ $# -gt 0 ]; do case "$(eval "printf %s \"\$HAVE_$1\"")" in 'yes') n='0' diff --git a/qb/qb.params.sh b/qb/qb.params.sh index fd20165c3c..01cf05e8eb 100644 --- a/qb/qb.params.sh +++ b/qb/qb.params.sh @@ -73,7 +73,7 @@ parse_input() # Parse stuff :V #OPTS contains all available options in config.params.sh - used to speedup #things in opt_exists() - while [ "$1" ]; do + while [ $# -gt 0 ]; do case "$1" in --prefix=*) PREFIX=${1##--prefix=};; --global-config-dir=*|--sysconfdir=*) GLOBAL_CONFIG_DIR="${1#*=}";; @@ -101,6 +101,8 @@ parse_input() # Parse stuff :V eval "$opt=\"$val\"" ;; -h|--help) print_help; exit 0;; + --) break ;; + '') : ;; *) die 1 "Unknown option $1";; esac shift