summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-15 18:14:56 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-15 18:14:56 +0200
commit547f94f33098b060da9d62c29d9fcbe9bf1e2b11 (patch)
tree3302f56d0b602ba870b55687c7141f3c4a4c4736
parentb5841b99e678da187b68c21f46d56a608a0dc10c (diff)
patch 8.2.3167: get E12 in a job callback when searching for tagsv8.2.3167
Problem: Get E12 in a job callback when searching for tags. (Andy Stewart) Solution: Use the sandbox only for executing a command, not for searching. (closes #8511)
-rw-r--r--src/tag.c32
-rw-r--r--src/version.c2
2 files changed, 18 insertions, 16 deletions
diff --git a/src/tag.c b/src/tag.c
index 256f885c82..4e96e0d430 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -3312,7 +3312,6 @@ jumpto_tag(
int forceit, // :ta with !
int keep_help) // keep help flag (FALSE for cscope)
{
- int save_secure;
optmagic_T save_magic_overruled;
int save_p_ws, save_p_scs, save_p_ic;
linenr_T save_lnum;
@@ -3500,11 +3499,6 @@ jumpto_tag(
curwin->w_set_curswant = TRUE;
postponed_split = 0;
- save_secure = secure;
- secure = 1;
-#ifdef HAVE_SANDBOX
- ++sandbox;
-#endif
save_magic_overruled = magic_overruled;
magic_overruled = OPTION_MAGIC_OFF; // always execute with 'nomagic'
#ifdef FEAT_SEARCH_EXTRA
@@ -3621,22 +3615,28 @@ jumpto_tag(
}
else
{
+ int save_secure = secure;
+
+ // Setup the sandbox for executing the command from the tags file.
+ secure = 1;
+#ifdef HAVE_SANDBOX
+ ++sandbox;
+#endif
curwin->w_cursor.lnum = 1; // start command in line 1
do_cmdline_cmd(pbuf);
retval = OK;
- }
- /*
- * When the command has done something that is not allowed make sure
- * the error message can be seen.
- */
- if (secure == 2)
- wait_return(TRUE);
- secure = save_secure;
- magic_overruled = save_magic_overruled;
+ // When the command has done something that is not allowed make
+ // sure the error message can be seen.
+ if (secure == 2)
+ wait_return(TRUE);
+ secure = save_secure;
#ifdef HAVE_SANDBOX
- --sandbox;
+ --sandbox;
#endif
+ }
+
+ magic_overruled = save_magic_overruled;
#ifdef FEAT_SEARCH_EXTRA
// restore no_hlsearch when keeping the old search pattern
if (search_options)
diff --git a/src/version.c b/src/version.c
index 896ca07b8b..6a4943d50f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3167,
+/**/
3166,
/**/
3165,