Skip to content

Commit 82e8c92

Browse files
committed
patch 8.1.0539: cannot build without the sandbox
Problem: Cannot build without the sandbox. Solution: Set the secure option instead of using the sandbox. Also restrict the characters from 'spelllang' that are used for LANG.vim. (suggested by Yasuhiro Matsumoto)
1 parent 5958f95 commit 82e8c92

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

runtime/doc/options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7339,7 +7339,7 @@ A jump table for the options with a short description can be found at |Q_op|.
73397339

73407340
After this option has been set successfully, Vim will source the files
73417341
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
7342-
up to the first comma, dot or underscore.
7342+
up to the first character that is not an ASCII letter and not a dash.
73437343
Also see |set-spc-auto|.
73447344

73457345

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,11 +5523,11 @@ chk_modeline(
55235523
current_sctx.sc_lnum = 0;
55245524
#endif
55255525
// Make sure no risky things are executed as a side effect.
5526-
++sandbox;
5526+
++secure;
55275527

55285528
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
55295529

5530-
--sandbox;
5530+
--secure;
55315531
#ifdef FEAT_EVAL
55325532
current_sctx = save_current_sctx;
55335533
#endif

src/option.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7758,10 +7758,13 @@ did_set_string_option(
77587758
* '.encoding'.
77597759
*/
77607760
for (p = q; *p != NUL; ++p)
7761-
if (vim_strchr((char_u *)"_.,", *p) != NULL)
7761+
if (!ASCII_ISALPHA(*p) && *p != '-')
77627762
break;
7763-
vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
7764-
source_runtime(fname, DIP_ALL);
7763+
if (p > q)
7764+
{
7765+
vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
7766+
source_runtime(fname, DIP_ALL);
7767+
}
77657768
}
77667769
#endif
77677770
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ static char *(features[]) =
792792

793793
static int included_patches[] =
794794
{ /* Add new patch number below this line */
795+
/**/
796+
539,
795797
/**/
796798
538,
797799
/**/

0 commit comments

Comments
 (0)