changeset 16082:2699db3e4d9d v8.1.1046

patch 8.1.1046: the "secure" variable is used inconsistently commit https://github.com/vim/vim/commit/82b033eff82d3ed0da77fd5f5a1c023766acabba Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 24 14:02:04 2019 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 24 Mar 2019 14:15:04 +0100
parents 5878e48ded93
children 2412e9d043a7
files src/buffer.c src/option.c src/version.c
diffstat 3 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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
-#endif
-				    || (opt_flags & OPT_MODELINE)
-				    || (!value_is_replaced && (*p & P_INSECURE)))
-				++secure;
+				  || sandbox != 0
+#endif
+				  || (!value_is_replaced && (*p & P_INSECURE)))
+				secure = 1;
 
 			    // Handle side effects, and set the global value
 			    // for ":set" on local options. Note: when setting
--- a/src/version.c
+++ b/src/version.c
@@ -776,6 +776,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1046,
+/**/
     1045,
 /**/
     1044,