From: Bram Moolenaar Date: Sun, 24 Mar 2019 13:02:04 +0000 (+0100) Subject: patch 8.1.1046: the "secure" variable is used inconsistently X-Git-Tag: v8.1.1046 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=82b033eff82d3ed0da77fd5f5a1c023766acabba;p=thirdparty%2Fvim.git 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. --- diff --git a/src/buffer.c b/src/buffer.c index 158c30a5a1..6cfa41fab6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5498,7 +5498,7 @@ chk_modeline( current_sctx.sc_lnum = 0; #endif // Make sure no risky things are executed as a side effect. - ++secure; + secure = 1; retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags); diff --git a/src/option.c b/src/option.c index f9cbcbd7b8..8149521fc1 100644 --- a/src/option.c +++ b/src/option.c @@ -5151,13 +5151,12 @@ 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) #ifdef HAVE_SANDBOX - || sandbox != 0 + || sandbox != 0 #endif - || (opt_flags & OPT_MODELINE) - || (!value_is_replaced && (*p & P_INSECURE))) - ++secure; + || (!value_is_replaced && (*p & P_INSECURE))) + secure = 1; // Handle side effects, and set the global value // for ":set" on local options. Note: when setting diff --git a/src/version.c b/src/version.c index 133fd3e572..3a195e5c49 100644 --- a/src/version.c +++ b/src/version.c @@ -775,6 +775,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1046, /**/ 1045, /**/