diff --git a/cc.sh b/cc.sh index 4156eed..6de15b2 100755 --- a/cc.sh +++ b/cc.sh @@ -356,7 +356,7 @@ esac # In vcheck mode, nothing is added in terms of extra search paths or # libraries. if [ -z "$mode" ] || [ "$mode" = ld ]; then - for arg in "$@"; do + for arg; do case $arg in -v|-V|--version|-dumpversion) mode=vcheck @@ -369,7 +369,7 @@ fi # Finish setting up the mode. if [ -z "$mode" ]; then mode=ccld - for arg in "$@"; do + for arg; do case $arg in -E) mode=cpp; break ;; -S) mode=as; break ;; @@ -434,7 +434,7 @@ export PATH="$new_dirs" if [ "$mode" = vcheck ]; then full_command_list="$command" extend full_command_list vcheck_flags - for arg in "$@"; do + for arg; do append full_command_list "$arg" done execute @@ -446,7 +446,7 @@ fi add_rpaths=true if [ "$mode" = ld ] || [ "$mode" = ccld ]; then if [ "${SPACK_SHORT_SPEC#*darwin}" != "${SPACK_SHORT_SPEC}" ]; then - for arg in "$@"; do + for arg; do if [ "$arg" = "-r" ]; then if [ "$mode" = ld ] || [ "$mode" = ccld ]; then add_rpaths=false diff --git a/test/run.sh b/test/run.sh index a59b0a9..373d5b9 100644 --- a/test/run.sh +++ b/test/run.sh @@ -62,7 +62,7 @@ fail() { # no trailing newline. concat() { _first=1 - for _piece in "$@"; do + for _piece; do [ -z "$_piece" ] && continue if [ "$_first" -eq 1 ]; then printf '%s' "$_piece"