From 3e580b185c50f655aba0b9664460520e916fbb1e Mon Sep 17 00:00:00 2001 From: throwawayaccount12345-1 <77868642+throwawayaccount12345-1@users.noreply.github.com> Date: Fri, 5 Nov 2021 13:43:18 -0300 Subject: [PATCH] rc/tools/make.kak: quote "${kak_opt_makecmd}" As per man page eval(1p): > The eval utility shall construct a command by concatenating arguments together, > separating each with a `` character. The constructed command shall be > read and executed by the shell. When not quoting `$kak_opt_makecmd` in the eval, the variable is split by newlines and spaces and then joined by spaces to form the command. If there were newlines in `$kak_opt_makecmd`, the command would be malformed. To reproduce: ```kak set-option global makecmd " echo foo echo bar" make a b c ``` Expected output in the `*make*` buffer: ``` foo bar a b c ``` Actual output: ``` foo echo bar a b c ``` This patch fixes this. --- rc/tools/make.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/tools/make.kak b/rc/tools/make.kak index 3c4fc3ac..1f8467a8 100644 --- a/rc/tools/make.kak +++ b/rc/tools/make.kak @@ -14,7 +14,7 @@ define-command -params .. \ } make %{ evaluate-commands %sh{ output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-make.XXXXXXXX)/fifo mkfifo ${output} - ( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null + ( eval "${kak_opt_makecmd}" "$@" > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{ edit! -fifo ${output} -scroll *make*