Просмотр исходного кода

strip initial `-` from the name of shell process

Avoids the case where shell detection would result in
`basename "-bash"` invocation, triggering the error:

    basename: illegal option -- b

fixes #462
pull/360/head^2
Mislav Marohnić 12 лет назад
Родитель
Сommit
3300587c6b
1 измененных файлов: 1 добавлений и 0 удалений
  1. +1
    -0
      libexec/rbenv-init

+ 1
- 0
libexec/rbenv-init Просмотреть файл

@ -23,6 +23,7 @@ done
shell="$1"
if [ -z "$shell" ]; then
shell="$(ps c -p $(ps -p $$ -o 'ppid=' 2>/dev/null) -o 'comm=' 2>/dev/null || true)"
shell="${shell##-}"
shell="$(basename "${shell:-$SHELL}")"
fi

Загрузка…
Отмена
Сохранить