1
0
forked from aniani/vim

patch 8.1.0439: recursive use of getcmdline() still not protected

Problem:    Recursive use of getcmdline() still not protected.
Solution:   Instead of saving the command buffer when making a call which may
            cause recursiveness, save the buffer when actually being called
            recursively.
This commit is contained in:
Bram Moolenaar
2018-09-30 17:11:48 +02:00
parent b434ae2a1f
commit 438d176e35
5 changed files with 63 additions and 97 deletions

View File

@@ -4666,7 +4666,6 @@ eval_map_expr(
char_u *res;
char_u *p;
char_u *expr;
char_u *save_cmd;
pos_T save_cursor;
int save_msg_col;
int save_msg_row;
@@ -4678,13 +4677,6 @@ eval_map_expr(
return NULL;
vim_unescape_csi(expr);
save_cmd = save_cmdline_alloc();
if (save_cmd == NULL)
{
vim_free(expr);
return NULL;
}
/* Forbid changing text or using ":normal" to avoid most of the bad side
* effects. Also restore the cursor position. */
++textlock;
@@ -4700,7 +4692,6 @@ eval_map_expr(
msg_col = save_msg_col;
msg_row = save_msg_row;
restore_cmdline_alloc(save_cmd);
vim_free(expr);
if (p == NULL)