From 1f1e291385ef2fecd48e5dccc68e7aaa6c7fe36b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 5 Apr 2017 16:29:18 -0400 Subject: [PATCH 1/3] Enforce absolute RBENV_DIR This prevents CDPATH from becoming an issue. Closes #866. --- libexec/rbenv | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rbenv b/libexec/rbenv index 07847a66..ee13f0c7 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -60,6 +60,7 @@ export RBENV_ROOT if [ -z "${RBENV_DIR}" ]; then RBENV_DIR="$PWD" else + [[ $RBENV_DIR == /* ]] || RBENV_DIR=$PWD/$RBENV_DIR cd "$RBENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$RBENV_DIR'" RBENV_DIR="$PWD" cd "$OLDPWD" From 9d93605e187cb44b66c9edd3086cac4d562512c3 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 5 Apr 2017 16:36:04 -0400 Subject: [PATCH 2/3] Don't unset CDPATH --- libexec/rbenv | 1 - 1 file changed, 1 deletion(-) diff --git a/libexec/rbenv b/libexec/rbenv index ee13f0c7..a9e0c8ec 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -1,6 +1,5 @@ #!/usr/bin/env bash set -e -unset CDPATH if [ "$1" = "--debug" ]; then export RBENV_DEBUG=1 From b80ea43e255bd7e2314cefe6cc503f656aa94130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 29 Nov 2017 15:51:03 +0100 Subject: [PATCH 3/3] Quote directory name in variable assignment --- libexec/rbenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rbenv b/libexec/rbenv index a9e0c8ec..ad5c97cb 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -59,7 +59,7 @@ export RBENV_ROOT if [ -z "${RBENV_DIR}" ]; then RBENV_DIR="$PWD" else - [[ $RBENV_DIR == /* ]] || RBENV_DIR=$PWD/$RBENV_DIR + [[ $RBENV_DIR == /* ]] || RBENV_DIR="$PWD/$RBENV_DIR" cd "$RBENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$RBENV_DIR'" RBENV_DIR="$PWD" cd "$OLDPWD"