diff --git a/tests/A nonempty CDPATH should not break urchin. b/tests/A nonempty CDPATH should not break urchin. new file mode 100755 index 0000000..cd585ec --- /dev/null +++ b/tests/A nonempty CDPATH should not break urchin. @@ -0,0 +1,6 @@ +#!/bin/sh + +cd .. +export CDPATH=$PWD +./urchin -f 'tests/urchin exit code' >/dev/null + diff --git a/urchin b/urchin index 3443ea5..b243290 100755 --- a/urchin +++ b/urchin @@ -1,5 +1,9 @@ #!/bin/sh +# Make sure that CDPATH isn't set, as it causes `cd` to behave unpredictably - notably, it can produce output, +# which breaks fullpath(). +unset CDPATH + fullpath() { ( cd -- "$1"