Mercurial > vim
diff src/getchar.c @ 14854:3b72808fbb0d v8.1.0439
patch 8.1.0439: recursive use of getcmdline() still not protected
commit https://github.com/vim/vim/commit/438d176e35c16d56ff3bb7a80300197ce5a30c4f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 30 17:11:48 2018 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 30 Sep 2018 17:15:08 +0200 |
parents | 0a3b9ecf7cb8 |
children | 27b9a84395b5 |
line wrap: on
line diff
--- a/src/getchar.c +++ b/src/getchar.c @@ -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)