diff options
author | midipix <writeonce@midipix.org> | 2019-10-20 00:17:44 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-10-20 00:22:04 +0000 |
commit | 6c3c34212478daf6221c3c37a2b8532e23b9a30c (patch) | |
tree | d80ce7d6ef5ee97bf0251eddfd09812a4891a2e3 | |
parent | 084f2e33cec5ae7aded5f26c79bc378de6508a5a (diff) | |
download | slibtool-6c3c34212478daf6221c3c37a2b8532e23b9a30c.tar.bz2 slibtool-6c3c34212478daf6221c3c37a2b8532e23b9a30c.tar.xz |
build system: ccenv.sh: support shells with private loop iteration variables.
-rw-r--r-- | sofort/ccenv/ccenv.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index d6f48f2..e28a1fb 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -51,14 +51,16 @@ ccenv_comment() ccenv_find_tool() { if [ -z "$ccenv_prefixes" ]; then - for ccenv_tool in $(printf %s "$ccenv_candidates"); do + for ccenv_candidate in $(printf %s "$ccenv_candidates"); do if [ -z ${@:-} ]; then - if command -v "$ccenv_tool" > /dev/null; then + if command -v "$ccenv_candidate" > /dev/null; then + ccenv_tool="$ccenv_candidate" return 0 fi else - if command -v "$ccenv_tool" > /dev/null; then - if "$ccenv_tool" $@ > /dev/null 2>&1; then + if command -v "$ccenv_candidate" > /dev/null; then + if "$ccenv_candidate" $@ > /dev/null 2>&1; then + ccenv_tool="$ccenv_candidate" return 0 fi fi @@ -80,8 +82,9 @@ ccenv_find_tool() done done - for ccenv_tool in $(printf %s "$ccenv_candidates"); do - if command -v "$ccenv_tool" > /dev/null; then + for ccenv_candidate in $(printf %s "$ccenv_candidates"); do + if command -v "$ccenv_candidate" > /dev/null; then + ccenv_tool="$ccenv_candidate" return 0 fi done |