From b81b64453bb66dc54b15e1c1b90430ead25f1f13 Mon Sep 17 00:00:00 2001 From: Eric Lindvall Date: Fri, 9 Sep 2011 15:00:59 -0700 Subject: [PATCH] Deal with an empty result from expand_path --- libexec/rbenv-which | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rbenv-which b/libexec/rbenv-which index 0f8fd2c5..89cba18c 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -16,6 +16,11 @@ remove_from_path() { local path_to_remove="$(expand_path "$1")" local result="" + if [ -z "$path_to_remove" ]; then + echo "${PATH}" + return + fi + for path in ${PATH//:/$'\n'}; do path="$(expand_path "$path" || true)" if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then