aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-05 11:23:25 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-05 11:38:21 -0400
commit9c6476d81e47f886e448579261192db6c9a92135 (patch)
tree51fc4064891da020424a6486f218575cfd1f3158 /src/nvim/option.c
parent0673b0d25148d666c1865aa24ff8c2f834faf29e (diff)
downloadrneovim-9c6476d81e47f886e448579261192db6c9a92135.tar.gz
rneovim-9c6476d81e47f886e448579261192db6c9a92135.tar.bz2
rneovim-9c6476d81e47f886e448579261192db6c9a92135.zip
vim-patch:8.1.0613: when executing an insecure function the secure flag is stuck
Problem: When executing an insecure function the secure flag is stuck. (Gabriel Barta) Solution: Restore "secure" instead of decrementing it. (closes vim/vim#3705) https://github.com/vim/vim/commit/48f377a476e4a3312aa0e3535aba170484b59483
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 41d3b03e41..b93f98f6c5 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1833,7 +1833,7 @@ int do_set(
{
uint32_t *p = insecure_flag(opt_idx, opt_flags);
- int did_inc_secure = false;
+ const int secure_saved = secure;
// When an option is set in the sandbox, from a
// modeline or in secure mode, then deal with side
@@ -1844,23 +1844,20 @@ int do_set(
|| sandbox != 0
|| (opt_flags & OPT_MODELINE)
|| (!value_is_replaced && (*p & P_INSECURE))) {
- did_inc_secure = true;
- secure++;
+ secure++;
}
- // Handle side effects, and set the global value for
- // ":set" on local options. Note: when setting 'syntax'
- // or 'filetype' autocommands may be triggered that can
- // cause havoc.
+ // Handle side effects, and set the global value
+ // for ":set" on local options. Note: when setting
+ // 'syntax' or 'filetype' autocommands may be
+ // triggered that can cause havoc.
errmsg = did_set_string_option(opt_idx, (char_u **)varp,
new_value_alloced, oldval,
errbuf, sizeof(errbuf),
opt_flags, &value_checked);
- if (did_inc_secure) {
- secure--;
- }
- }
+ secure = secure_saved;
+ }
if (errmsg == NULL) {
if (!starting) {