# HG changeset patch # User Jim Meyering # Date 1383001696 25200 # Node ID 336fcfecc05e3be9206d73914664760a96e00734 # Parent 9b560a24dd4eabcd504d64a7f040eca4b312dd7c gnulib-tool: protect against CDPATH * gnulib-tool: Many "cd" built-in functions print a directory name to stdout when CDPATH is set, e.g., $ bash -c 'CDPATH=/; cd tmp' /tmp Unset it, when possible. Prompted by a comment from Bruce Korb. diff -r 9b560a24dd4e -r 336fcfecc05e ChangeLog --- a/ChangeLog Mon Oct 28 15:25:25 2013 -0700 +++ b/ChangeLog Mon Oct 28 16:08:16 2013 -0700 @@ -1,5 +1,12 @@ 2013-10-28 Jim Meyering + gnulib-tool: protect against CDPATH + * gnulib-tool: Many "cd" built-in functions print a directory name + to stdout when CDPATH is set, e.g., + $ bash -c 'CDPATH=/; cd tmp' + /tmp + Unset it, when possible. Prompted by a comment from Bruce Korb. + maint.mk: restore functionality removed by recent change... Sunday's change, v0.0-8062-g6b24f60, may have appeared correct from the context of a shallow-cloned gnulib repository: "git describe" diff -r 9b560a24dd4e -r 336fcfecc05e gnulib-tool --- a/gnulib-tool Mon Oct 28 15:25:25 2013 -0700 +++ b/gnulib-tool Mon Oct 28 16:08:16 2013 -0700 @@ -898,6 +898,9 @@ shift fi +# Unset CDPATH. Otherwise, output from 'cd dir' can surprise callers. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + # Command-line option processing. # Removes the OPTIONS from the arguments. Sets the variables: # - mode one of: list, find, import, add-import, remove-import,