bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Set PATH_SEPARATOR the same way autoconf does.


From: Stefano Lattarini
Subject: [PATCH] Set PATH_SEPARATOR the same way autoconf does.
Date: Sat, 4 Sep 2010 00:06:11 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

A mostly cosmetic patch.  Maybe you can find it worth applying anyway.

Regards,
   Stefano

-*-*-

* gnulib-tool (func_gnulib_dir): Determine the value of
PATH_SEPARATOR the same way autoconf-generated configure
scripts do.
* posix-modules: Likewise.
---
 ChangeLog     |    8 ++++++++
 gnulib-tool   |   15 ++++++---------
 posix-modules |   15 ++++++---------
 3 files changed, 20 insertions(+), 18 deletions(-)
From 1c02d072eac6e06d25788b455bc379a70ed18010 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 3 Sep 2010 23:31:24 +0200
Subject: [PATCH] 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.
---
 ChangeLog     |    8 ++++++++
 gnulib-tool   |   15 ++++++---------
 posix-modules |   15 ++++++---------
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5be2ceb..c079caf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-04  Stefano Lattarini  <address@hidden>  (tiny change)
+
+       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.
+
 2010-09-02  Paul Eggert  <address@hidden>
 
        hash: fix safe_hasher const typo
diff --git a/gnulib-tool b/gnulib-tool
index b606ad6..b3f4449 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -371,16 +371,13 @@ func_gnulib_dir ()
       # The 'case' statement is an optimization, to avoid evaluating the
       # explicit canonicalization command when $PATH contains no empty fields.
       self_abspathname=
+      # Code to determine PATH_SEPARATOR stolen from autoconf 2.67.
       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"
+        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.
diff --git a/posix-modules b/posix-modules
index 46de93d..d656a4b 100755
--- a/posix-modules
+++ b/posix-modules
@@ -114,16 +114,13 @@ func_gnulib_dir ()
       # The 'case' statement is an optimization, to avoid evaluating the
       # explicit canonicalization command when $PATH contains no empty fields.
       self_abspathname=
+      # Code to determine PATH_SEPARATOR stolen from autoconf 2.67.
       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"
+        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.
-- 
1.7.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]