]> granicus.if.org Git - vim/commitdiff
patch 8.1.1295: when vimrun.exe does not exist external command may fail v8.1.1295
authorBram Moolenaar <Bram@vim.org>
Tue, 7 May 2019 21:01:39 +0000 (23:01 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 7 May 2019 21:01:39 +0000 (23:01 +0200)
Problem:    When vimrun.exe does not exist external command may fail.
Solution:   Use "cmd /c" twice to get the same behavior. (Ken Takata,
            closes #4355)

src/os_win32.c
src/version.c

index 537af4675f6c7d2866826cc719e46ce37883819d..cbb09af5ff6b2ece4598425f040b9c225e4f69ed 100644 (file)
@@ -4827,11 +4827,14 @@ mch_call_shell(
        }
        else
        {
-           cmdlen = (
+           cmdlen =
 #ifdef FEAT_GUI_MSWIN
-               (gui.in_use ? (!p_stmp ? 0 : STRLEN(vimrun_path)) : 0) +
+               (gui.in_use ?
+                   (!s_dont_use_vimrun && p_stmp ?
+                       STRLEN(vimrun_path) : STRLEN(p_sh) + STRLEN(p_shcf))
+                   : 0) +
 #endif
-               STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
+               STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10;
 
            newcmd = lalloc(cmdlen, TRUE);
            if (newcmd != NULL)
@@ -4869,9 +4872,19 @@ mch_call_shell(
                                                                 ? "-s " : "",
                            p_sh, p_shcf, cmd);
                else
+# ifdef VIMDLL
+               if (gui.in_use)
+# endif
+                   vim_snprintf((char *)newcmd, cmdlen, "%s %s %s %s %s",
+                                          p_sh, p_shcf, p_sh, p_shcf, cmd);
+# ifdef VIMDLL
+               else
+# endif
 #endif
+#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)
                    vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
                                                           p_sh, p_shcf, cmd);
+#endif
                x = mch_system((char *)newcmd, options);
                vim_free(newcmd);
            }
index 06a7a5f687826c5026715441adb3f78dfa63320d..32066b4f6156c5b5cf90adfeb784a3d8925f876b 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1295,
 /**/
     1294,
 /**/