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.
82b033eff8
This commit is contained in:
Jan Edmund Lazo
2019-05-05 11:38:34 -04:00
parent 9c6476d81e
commit fb02e9f1e9
2 changed files with 3 additions and 4 deletions

View File

@@ -5116,7 +5116,7 @@ chk_modeline(
save_SID = current_SID; save_SID = current_SID;
current_SID = SID_MODELINE; current_SID = SID_MODELINE;
// Make sure no risky things are executed as a side effect. // Make sure no risky things are executed as a side effect.
secure++; secure = 1;
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags); retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);

View File

@@ -1840,11 +1840,10 @@ int do_set(
// effects in secure mode. Also when the value was // effects in secure mode. Also when the value was
// set with the P_INSECURE flag and is not // set with the P_INSECURE flag and is not
// completely replaced. // completely replaced.
if (secure if ((opt_flags & OPT_MODELINE)
|| sandbox != 0 || sandbox != 0
|| (opt_flags & OPT_MODELINE)
|| (!value_is_replaced && (*p & P_INSECURE))) { || (!value_is_replaced && (*p & P_INSECURE))) {
secure++; secure = 1;
} }
// Handle side effects, and set the global value // Handle side effects, and set the global value