0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

patch 7.4.1662

Problem:    No test for an invalid Ex command on a channel.
Solution:   Test handling an invalid command gracefully.  Avoid getting an
            error message, do write it to the channel log.
This commit is contained in:
Bram Moolenaar
2016-03-26 22:56:46 +01:00
parent fa8b2e173d
commit c4dcd60c76
4 changed files with 21 additions and 0 deletions

View File

@@ -1661,8 +1661,17 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
if (STRCMP(cmd, "ex") == 0)
{
int save_called_emsg = called_emsg;
called_emsg = FALSE;
ch_logs(channel, "Executing ex command '%s'", (char *)arg);
++emsg_silent;
do_cmdline_cmd(arg);
--emsg_silent;
if (called_emsg)
ch_logs(channel, "Ex command error: '%s'",
(char *)get_vim_var_str(VV_ERRMSG));
called_emsg = save_called_emsg;
}
else if (STRCMP(cmd, "normal") == 0)
{