diff --git a/minimal/do b/minimal/do index bd78473..258a25e 100755 --- a/minimal/do +++ b/minimal/do @@ -17,6 +17,9 @@ usage: do [-d] [-x] [-v] [-c] It will never rebuild a target it has already built, unless you use -c. " +# CDPATH apparently causes unexpected 'cd' output on some platforms. +unset CDPATH + # By default, no output coloring. green="" bold="" diff --git a/redo/builder.py b/redo/builder.py index 01ada27..bebc1fa 100644 --- a/redo/builder.py +++ b/redo/builder.py @@ -309,6 +309,8 @@ class _BuildJob(object): # now. assert state.is_flushed() newp = os.path.realpath(dodir) + # CDPATH apparently caused unexpected 'cd' output on some platforms. + os.unsetenv('CDPATH') os.environ['REDO_PWD'] = state.relpath(newp, env.v.STARTDIR) os.environ['REDO_TARGET'] = basename + ext os.environ['REDO_DEPTH'] = env.v.DEPTH + ' ' diff --git a/t/shelltest.od b/t/shelltest.od index a568b86..948a36c 100644 --- a/t/shelltest.od +++ b/t/shelltest.od @@ -513,7 +513,7 @@ x=$(printf "a%-5sc" "b") [ "$x" = "ab c" ] || warn 119 # Make sure cd supports -L and -P options properly -rm -f shlink +rm -f shlink ../shlink ln -s . shlink (quiet_stderr cd -L shlink/shlink/shlink/../shlink) || fail 120 (quiet_stderr cd -P shlink/shlink/shlink/../shlink) && fail 121