From 754c6f68ceb32b8ba8478843f898100596674f26 Mon Sep 17 00:00:00 2001 From: Ryan Winograd Date: Mon, 25 Apr 2022 15:45:06 -0500 Subject: [PATCH] Shellescape new annotations Shellescape the annotation input to prevent errors when entering a string with shell glob characters, such as question marks (?) or asterisks (*). The error can be observed by attempting to insert an annotation such as "hello?world". Without the fix, the annotation simply fails to be added to the task. You can make it more obvious as to what the underlying issue is by changing the last argument of `system_call` from 'silent' to 'echo'. --- autoload/taskwarrior/action.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/taskwarrior/action.vim b/autoload/taskwarrior/action.vim index 12471f6..d4df8d7 100644 --- a/autoload/taskwarrior/action.vim +++ b/autoload/taskwarrior/action.vim @@ -126,7 +126,7 @@ function! taskwarrior#action#annotate(op) endif if a:op == 'add' let annotation = input('new annotation:', '', 'file') - call taskwarrior#system_call(uuid, ' annotate ', annotation, 'silent') + call taskwarrior#system_call(uuid, ' annotate ', shellescape(annotation), 'silent') elseif a:op == 'del' let annotation = input('annotation pattern to delete:') call taskwarrior#system_call(uuid, ' denotate ', annotation, 'silent')