summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-07 23:01:39 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-07 23:01:39 +0200
commit98ffe4c6d8bded840436cfec0f26dd9c9bce4939 (patch)
treeb2a10664f55c91ee37548e01300ada9613a2a1ee /src/os_win32.c
parent93d77b2cbec08518ee426d0c44c50cf505732443 (diff)
downloadvim-git-98ffe4c6d8bded840436cfec0f26dd9c9bce4939.tar.gz
patch 8.1.1295: when vimrun.exe does not exist external command may failv8.1.1295
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)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 537af4675..cbb09af5f 100644
--- 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) +
+ (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);
}