X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=posix-modules;h=b93b28381abe06665ed8a5d81471a50f54e99de9;hb=769da91bf5bcd63f9548af5cdc0f4b087090ee05;hp=46de93d26059583ce423458f8c71c83518711b62;hpb=fd9f58dc85f6a45cd244c78a54ad4610c01dbb15;p=gnulib.git diff --git a/posix-modules b/posix-modules index 46de93d26..b93b28381 100755 --- a/posix-modules +++ b/posix-modules @@ -115,15 +115,14 @@ func_gnulib_dir () # explicit canonicalization command when $PATH contains no empty fields. self_abspathname= 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 if test "$PATH_SEPARATOR" = ";"; then # On Windows, programs are searched in "." before $PATH.