]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Don't assume "." is writeable, for commands like "autoconf --version".
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 5 Oct 2007 22:31:06 +0000 (15:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 5 Oct 2007 22:31:06 +0000 (15:31 -0700)
* lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Use a
different heuristic instead, one that doesn't rely on creating
files.

ChangeLog
lib/m4sugar/m4sh.m4

index 666c07f9a692291cfc997333e6bb77ce03194de1..0afda13906864a6c67211dd75769cd624ee74723 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-10-05  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Don't assume "." is writeable, for commands like "autoconf --version".
+       * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Use a
+       different heuristic instead, one that doesn't rely on creating
+       files.
+
        * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Handle "///"
        correctly.
 
index 8d441ab0c6829b9d66b9c8afc0bae7ed5916e222..e8bce4016948e6eafe9dd9a0cf56e89791f4f2a8 100644 (file)
@@ -1037,15 +1037,11 @@ fi
 m4_defun([_AS_PATH_SEPARATOR_PREPARE],
 [# The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; FPATH=$PATH; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  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
 ])# _AS_PATH_SEPARATOR_PREPARE