From 5ae2cac088d12fea01054e1f3abbf304b92920b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sat, 28 Sep 2013 15:58:13 +0200 Subject: [PATCH] fix `rbenv()` function in ksh and dash ksh syntax becomes: function rbenv { typeset command `typeset` only declares a local variable if there's an explicit `function` declaration; otherwise the variable leaks. Other shells use this syntax: rbenv() { local command This is for dash compatibility, which supports neither `function` nor `typeset`. references #205, fixes #408 --- libexec/rbenv-init | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index c240460d..1a2762c7 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -122,13 +122,25 @@ function rbenv command rbenv "\$command" \$argv end end +EOS + exit 0 + ;; +ksh ) + cat <