From f960594cd4b85e52ea72f80d517be3e026e23c09 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Tue, 17 Jul 2018 11:37:23 +0000 Subject: [PATCH] Fix borked version display for mksh `"$SHELL" -c "printf %s \$KSH_VERSION"` as part of the shell version detection for ksh and mksh was expanding to `printf %s $KSH_VERSION` inside of shell. This resulted in `$KSH_VERSION` being substituted as multiple arguments to printf. While (afaik) unspecified, mksh, bash and zsh resort to repeating the format strings. This resulted in all spaces missing from `$shell`, which in turn caused the string cleanup to fail: `Shell: mksh @MIRBSDKSHR562017/08/29` Quoting `$KSH_VERSION` causes it to be given to printf as a single argument, which preserves its spaces. The output after this change looks like follows: `Shell: mksh R56 2017/08/29` --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index d8be94f5..b33ca405 100755 --- a/neofetch +++ b/neofetch @@ -1366,7 +1366,7 @@ get_shell() { "sh" | "ash" | "dash") ;; "mksh" | "ksh") - shell+="$("$SHELL" -c "printf %s \$KSH_VERSION")" + shell+="$("$SHELL" -c "printf %s \"\$KSH_VERSION\"")" shell="${shell/ * KSH}" shell="${shell/version}" ;;