1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Actually deactivate CDPATH when unsetting it

After 'unset CDPATH', CDPATH continued to work as if nothing
happened. Unsetting it should be a valid way to deactivate it.

This bug is in every ksh93 version.

src/cmd/ksh93/bltins/cd_pwd.c: b_cd():
- Fix a manifest logic error: first check if CDPATH (CDPNOD) is
  unset before assigning to 'cdpath', not the other way around.
  Setting the 'cdpath' pointer is what activates the CDPATH search.
This commit is contained in:
Martijn Dekker 2021-12-28 23:53:08 +00:00
parent de511cfbc2
commit 57ed1efc2c
3 changed files with 5 additions and 1 deletions

View file

@ -305,6 +305,8 @@ x=$(cd ${tmp#/})
if [[ $x != $tmp ]]
then err_exit "CDPATH ${tmp#/} does not display new directory"
fi
unset CDPATH
cd "${tmp#/}" >/dev/null 2>&1 && err_exit "CDPATH not deactivated after unset"
cd "$tmp" || exit
TMOUT=100
(TMOUT=20)