X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Frelocatable.sh.in;h=ecfc2ccacafd24543c5c30da4d2be265916148bf;hb=cb33aca29894edd6d93b61676fac09666352f610;hp=16f98e6a87cbd738c7ae97efb93195158473f10b;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/build-aux/relocatable.sh.in b/build-aux/relocatable.sh.in index 16f98e6a8..ecfc2ccac 100644 --- a/build-aux/relocatable.sh.in +++ b/build-aux/relocatable.sh.in @@ -62,15 +62,14 @@ func_find_curr_installdir () */* | *\\*) ;; *) # Need to look in the PATH. if test "${PATH_SEPARATOR+set}" != set; then - func_tmpdir - { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh - chmod +x "$tmp"/conf.sh - if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -rf "$tmp" + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi save_IFS="$IFS"; IFS="$PATH_SEPARATOR" for dir in $PATH; do