From cf0fb478a2d208c0cf143c1466ccc75bb91044a6 Mon Sep 17 00:00:00 2001 From: Jay Caines-Gooby Date: Wed, 20 May 2026 17:31:02 +0100 Subject: [PATCH] Fix #263 Remove the case statement inside the interpolated subshell which would need its parens escaping. Use a comparison instead. --- activate.sh | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/activate.sh b/activate.sh index 327de27..83d2141 100755 --- a/activate.sh +++ b/activate.sh @@ -282,24 +282,21 @@ autoenv_leave() { \command -v chdir >/dev/null 2>&1 && \chdir "${from_dir}" || \builtin cd "${from_dir}" _hadone='' while [ "$PWD" != "" ] && [ "$PWD" != "/" ]; do - case $to_dir/ in - $PWD/*) - \break - ;; - *) - _file="$PWD/${AUTOENV_ENV_LEAVE_FILENAME}" - if [ -f "${_file}" ]; then - if [ -z "${_hadone}" ]; then - \printf %s "${_file}" - _hadone='1' - else - \printf %s " + if [ "$to_dir/" = "$PWD/" ]; then + \break + fi + + _file="$PWD/${AUTOENV_ENV_LEAVE_FILENAME}" + if [ -f "${_file}" ]; then + if [ -z "${_hadone}" ]; then + \printf %s "${_file}" + _hadone='1' + else + \printf %s " ${_file}" - fi - fi - \command -v chdir >/dev/null 2>&1 && \chdir "$(\pwd)/.." || \builtin cd "$PWD/.." - ;; - esac + fi + fi + __autoenv_cd "$PWD/.." done )