:echo maktaba#syscall#Create('(echo "hello not a format string: %" >&2; exit 1)').Call()
Error detected while processing function maktaba#syscall#Call[3]..<SNR>144_DoSyscallCommon:
line 31:
E605: Exception not caught: ERROR(ShellError): Error running: (echo "hello not a format string: %" >&2; exit 1)^@hello not a format string: ^@
(which is, presumably, correct)
vs.
:echo maktaba#syscall#Create('(echo "hello a format string: %s" >&2; exit 1)').Call()
Error detected while processing function maktaba#syscall#Call[3]..<SNR>144_DoSyscallCommon[31]..maktaba#error#Message[1]..maktaba#error#Exception:
line 5:
E766: Insufficient arguments for printf()
Error detected while processing function maktaba#syscall#Call[3]..<SNR>144_DoSyscallCommon:
line 31:
E605: Exception not caught: -1
The non-error path is fine:
:echo maktaba#syscall#Create('(echo "hello a format string: %s" >&2)').Call()
{'stderr': 'hello a format string: %s
', 'stdout': ''}
https://github.com/google/vim-maktaba/blob/master/autoload/maktaba/syscall.vim#L79 appends stderr to a message string that's (eventually) passed to
printf()
, but this is invalid if that stderr contains something that looks like a format string.e.g.
(which is, presumably, correct)
vs.
The non-error path is fine: