From 28c2a36d502603738c26d59f7d9bd16f27010835 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 19 Apr 2012 16:02:23 +0200 Subject: [PATCH] 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 --- ChangeLog | 13 +++++++++++++ build-aux/bootstrap | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c980aa3d4..693ad2459 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2012-04-19 Jim Meyering + + 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 and Jim Meyering diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 16dc15c9f..4afc6c44e 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -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 -- 2.11.0