Commit e2608b70 authored by Jan Edmund Lazo's avatar Jan Edmund Lazo Committed by James McCoy

vim-patch:8.1.1046: the "secure" variable is used inconsistently

Problem:    the "secure" variable is used inconsistently. (Justin M. Keyes)
Solution:   Set it to one instead of incrementing.
https://github.com/vim/vim/commit/82b033eff82d3ed0da77fd5f5a1c023766acabba

(cherry picked from commit ad8bba10)
Signed-off-by: James McCoy's avatarJames McCoy <jamessan@debian.org>
parent ded9c614
......@@ -4927,7 +4927,7 @@ chk_modeline (
save_SID = current_SID;
current_SID = SID_MODELINE;
// Make sure no risky things are executed as a side effect.
++secure;
secure = 1;
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
......
......@@ -1787,11 +1787,10 @@ do_set (
// effects in secure mode. Also when the value was
// set with the P_INSECURE flag and is not
// completely replaced.
if (secure
if ((opt_flags & OPT_MODELINE)
|| sandbox != 0
|| (opt_flags & OPT_MODELINE)
|| (!value_is_replaced && (*p & P_INSECURE))) {
secure++;
secure = 1;
}
// Handle side effects, and set the global value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment