summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-05-07 07:29:52 +1000
committerMaxime Coste <mawww@kakoune.org>2018-07-05 07:54:28 +1000
commitec1696960982464ead78efcaa0406c71d8acc12d (patch)
treeedca1ef620e4472697971b30e71d5ff343c96759 /share
parent3b9818c10b6f3c6fd19aa90115c4c3e14dc2d236 (diff)
Do not reparse %sh{...} strings
Automatic reparsing of %sh{...}, while convenient in many cases, can be surprising as well, and can lead to security problems: 'echo %sh{ printf "foo\necho bar" }' runs 'echo foo', then 'echo bar'. we make this danger explicit, and we fix the 'nop %sh{...}' pattern. To reparse %sh{...} strings, they can be passed to evaluate-commands, which has been fixed to work in every cases where %sh{...} reparsing was used..
Diffstat (limited to 'share')
-rw-r--r--share/kak/kakrc4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/kak/kakrc b/share/kak/kakrc
index fb8d16c7..03ef7139 100644
--- a/share/kak/kakrc
+++ b/share/kak/kakrc
@@ -6,7 +6,7 @@ def -params 1 -docstring "colorscheme <name>: enable named colorscheme" \
printf %s\\n "${basename%.*}"
done | sort -u
} \
- colorscheme %{ %sh{
+ colorscheme %{ evaluate-commands %sh{
find_colorscheme() {
find -L "${1}" -type f -name "${2}".kak | head -n 1
}
@@ -25,7 +25,7 @@ def -params 1 -docstring "colorscheme <name>: enable named colorscheme" \
fi
}}
-%sh{
+evaluate-commands %sh{
autoload_directory() {
find -L "$1" -type f -name '*\.kak' \
-exec printf 'try %%{ source "%s" } catch %%{ echo -debug Autoload: could not load "%s" }\n' '{}' '{}' \;