diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-30 08:32:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 08:32:12 +0800 |
commit | e5428d10b5a49e9395190482ff35bbac0c1117ea (patch) | |
tree | 9d3c290de9b71bbe892a4127a70cc270cb2360e2 /src/nvim/getchar.c | |
parent | 2f378237037150f3c7405fec1d8762e73067d223 (diff) | |
download | rneovim-e5428d10b5a49e9395190482ff35bbac0c1117ea.tar.gz rneovim-e5428d10b5a49e9395190482ff35bbac0c1117ea.tar.bz2 rneovim-e5428d10b5a49e9395190482ff35bbac0c1117ea.zip |
vim-patch:8.1.0439: recursive use of getcmdline() still not protected (#17726)
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.
https://github.com/vim/vim/commit/438d176e35c16d56ff3bb7a80300197ce5a30c4f
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Clear ccline earlier in save_cmdline() if ccline is in use so that
ccline.prev_ccline can be assigned.
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index c10172cc52..b12b99b7ee 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -4001,7 +4001,6 @@ static char_u *eval_map_expr(mapblock_T *mp, int c) char_u *res; char_u *p = NULL; char_u *expr = NULL; - char_u *save_cmd; pos_T save_cursor; int save_msg_col; int save_msg_row; @@ -4013,8 +4012,6 @@ static char_u *eval_map_expr(mapblock_T *mp, int c) vim_unescape_ks(expr); } - save_cmd = save_cmdline_alloc(); - // Forbid changing text or using ":normal" to avoid most of the bad side // effects. Also restore the cursor position. textlock++; @@ -4045,8 +4042,6 @@ static char_u *eval_map_expr(mapblock_T *mp, int c) msg_col = save_msg_col; msg_row = save_msg_row; - restore_cmdline_alloc(save_cmd); - if (p == NULL) { return NULL; } |