]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: don't let a user's CDPATH setting affect this script
authorJim Meyering <meyering@redhat.com>
Thu, 19 Apr 2012 14:02:23 +0000 (16:02 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 19 Apr 2012 14:07:12 +0000 (16:07 +0200)
When CDPATH is set, cd will sometimes generate output.
When "cd" is run in a subshell whose output matters, that
surprising-to-some output can cause malfunction.
Unsetting CDPATH turns off this shell "feature."
* build-aux/bootstrap (CDPATH): Unset.
Reported by Reuben Thomas in:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/30435
and inspired by his patch here:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/30440

ChangeLog
build-aux/bootstrap

index c980aa3d49a01617cee9251e7f51435505269f11..693ad245956575ed0f846f95322ab8512effa3b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2012-04-19  Jim Meyering  <meyering@redhat.com>
+
+       bootstrap: don't let a user's CDPATH setting affect this script
+       When CDPATH is set, cd will sometimes generate output.
+       When "cd" is run in a subshell whose output matters, that
+       surprising-to-some output can cause malfunction.
+       Unsetting CDPATH turns off this shell "feature."
+       * build-aux/bootstrap (CDPATH): Unset.
+       Reported by Reuben Thomas in:
+       http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/30435
+       and inspired by his patch here:
+       http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/30440
+
 2012-04-16  Akim Demaille  <akim@lrde.epita.fr>
        and Jim Meyering  <meyering@redhat.com>
 
index 16dc15c9fb7d3edce634f2b4d696690b879379a3..4afc6c44ea01be88e7540b0f6ba7f6870988443b 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2012-04-16.16; # UTC
+scriptversion=2012-04-19.14; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -36,6 +36,10 @@ nl='
 LC_ALL=C
 export LC_ALL
 
+# Ensure that CDPATH is not set.  Otherwise, the output from cd
+# would cause trouble in at least one use below.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
 local_gl_dir=gl
 
 me=$0