From 82a3f10a82a4c481c684c9b0d2448c104c2b87b7 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 12 Apr 2016 10:41:16 +0300 Subject: [PATCH] Fix arbitrary keys execution in the `doc` command --- rc/core/doc.kak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/core/doc.kak b/rc/core/doc.kak index 2af28b5a..01477116 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -18,7 +18,8 @@ def -hidden -params 1..2 _doc-open %{ " if [ $# -gt 1 ]; then - echo "try %{ exec '%(?i)^\h+[^\n]*?\Q${2}\E\'' } catch %{ exec gg }" + needle=$(printf %s "$2" | sed 's,<,,g') + echo "try %{ exec '%(?i)^\h+[^\n]*?\Q${needle}\E\'' } catch %{ exec gg }" fi else echo "echo -color Error %{doc '$@' failed: see *debug* buffer for details}"