]> granicus.if.org Git - vim/commitdiff
patch 8.2.2103: Vim9: unreachable code v8.2.2103
authorBram Moolenaar <Bram@vim.org>
Sun, 6 Dec 2020 19:12:43 +0000 (20:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 6 Dec 2020 19:12:43 +0000 (20:12 +0100)
Problem:    Vim9: unreachable code.
Solution:   Remove the code to prepend s: to the variable name

src/version.c
src/vim9compile.c

index f023d974a75166c7b9691bda141ea801e881e313..2444f0bda538be11cb7d76bf576b73e00276d511 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2103,
 /**/
     2102,
 /**/
index bfa54fea766ba5f726ee9b2d1a7be69cfba34c29..9f2aaba983e99284fef9e9ed93600386ea82fc92 100644 (file)
@@ -5179,19 +5179,9 @@ generate_store_var(
            if (scriptvar_idx < 0)
            {
                char_u  *name_s = name;
-               int         r;
+               int     r;
 
-               // Include s: in the name for store_var()
-               if (name[1] != ':')
-               {
-                   int len = (int)STRLEN(name) + 3;
-
-                   name_s = alloc(len);
-                   if (name_s == NULL)
-                       name_s = name;
-                   else
-                       vim_snprintf((char *)name_s, len, "s:%s", name);
-               }
+               // "s:" is included in the name.
                r = generate_OLDSCRIPT(cctx, ISN_STORES, name_s,
                                                          scriptvar_sid, type);
                if (name_s != name)