]> granicus.if.org Git - vim/commitdiff
patch 8.1.0539: cannot build without the sandbox v8.1.0539
authorBram Moolenaar <Bram@vim.org>
Tue, 20 Nov 2018 12:32:36 +0000 (13:32 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 20 Nov 2018 12:32:36 +0000 (13:32 +0100)
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)

runtime/doc/options.txt
src/buffer.c
src/option.c
src/version.c

index e57de8f174af6192a6698ba180af8ef01b4a651e..8a106e16ff2fc2c0a2bdf64f18fe354b4c6e524c 100644 (file)
@@ -7339,7 +7339,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 
        After this option has been set successfully, Vim will source the files
        "spell/LANG.vim" in 'runtimepath'.  "LANG" is the value of 'spelllang'
-       up to the first comma, dot or underscore.
+       up to the first character that is not an ASCII letter and not a dash.
        Also see |set-spc-auto|.
 
 
index ee962b2e8f47f226cb042d2a5723e3e4e6903cc3..8235a4fcaa66c53580f6d645bc29891c2ebc1a63 100644 (file)
@@ -5523,11 +5523,11 @@ chk_modeline(
                current_sctx.sc_lnum = 0;
 #endif
                // Make sure no risky things are executed as a side effect.
-               ++sandbox;
+               ++secure;
 
                retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
 
-               --sandbox;
+               --secure;
 #ifdef FEAT_EVAL
                current_sctx = save_current_sctx;
 #endif
index a4a9c9711d90ed6370980a8b24f34573e2b13562..e6d46aadf46c2237005858b702e2464bed8e5bad 100644 (file)
@@ -7758,10 +7758,13 @@ did_set_string_option(
             * '.encoding'.
             */
            for (p = q; *p != NUL; ++p)
-               if (vim_strchr((char_u *)"_.,", *p) != NULL)
+               if (!ASCII_ISALPHA(*p) && *p != '-')
                    break;
-           vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
-           source_runtime(fname, DIP_ALL);
+           if (p > q)
+           {
+               vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
+               source_runtime(fname, DIP_ALL);
+           }
        }
 #endif
     }
index 856941742ebc56c8e8f1dbd1696ad0c48e3800c7..a6f155f65193dd9197f613cb307d67fba49e6c38 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    539,
 /**/
     538,
 /**/