changeset 16584:29a0a549c790 v8.1.1295

patch 8.1.1295: when vimrun.exe does not exist external command may fail commit https://github.com/vim/vim/commit/98ffe4c6d8bded840436cfec0f26dd9c9bce4939 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 7 23:01:39 2019 +0200 patch 8.1.1295: when vimrun.exe does not exist external command may fail 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 07 May 2019 23:15:05 +0200
parents 77be2ead32ff
children f7b1c58bcf8b
files src/os_win32.c src/version.c
diffstat 2 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4827,11 +4827,14 @@ mch_call_shell(
 	}
 	else
 	{
-	    cmdlen = (
+	    cmdlen =
 #ifdef FEAT_GUI_MSWIN
-		(gui.in_use ? (!p_stmp ? 0 : STRLEN(vimrun_path)) : 0) +
-#endif
-		STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
+		(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;
 
 	    newcmd = lalloc(cmdlen, TRUE);
 	    if (newcmd != NULL)
@@ -4869,9 +4872,19 @@ mch_call_shell(
 								 ? "-s " : "",
 			    p_sh, p_shcf, cmd);
 		else
-#endif
+# 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);
 	    }
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1295,
+/**/
     1294,
 /**/
     1293,