diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2010-09-04 11:01:27 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-09-04 11:01:27 +0200 |
commit | 60b4ba664df4642893c35ae81dd47ff3396d40ec (patch) | |
tree | 89a3c0aafd220067c77080578349bc26271eb2ba /posix-modules | |
parent | 9f0cd590f76f5e5e942fbd90b253c90ca7c80699 (diff) | |
download | gnulib-60b4ba664df4642893c35ae81dd47ff3396d40ec.tar.gz |
Set PATH_SEPARATOR the same way autoconf does.
* gnulib-tool (func_gnulib_dir): Determine the value of PATH_SEPARATOR
the same way autoconf-generated configure scripts do.
* posix-modules: Likewise.
Diffstat (limited to 'posix-modules')
-rwxr-xr-x | posix-modules | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/posix-modules b/posix-modules index 46de93d260..b93b28381a 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. |