summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-02-22 15:34:08 +0100
committerBram Moolenaar <Bram@vim.org>2012-02-22 15:34:08 +0100
commitee7d100091f73a19cb82173a7c69832a738388ce (patch)
tree326af82f74db87ba084b39a3e3ef580c1ad3afb1 /src/os_win32.c
parent42ec656524db254001caee8feb58d26f67b52fbe (diff)
downloadvim-git-ee7d100091f73a19cb82173a7c69832a738388ce.tar.gz
updated for version 7.3.450v7.3.450
Problem: Win32: Still a problem with "!start /b". Solution: Fix pointer use. (Yasuhiro Matsumoto)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 2f764d3dc..57f004ec2 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4008,21 +4008,23 @@ mch_call_shell(
if (flags != CREATE_NEW_CONSOLE)
{
char_u *subcmd;
- char_u *cmd_shell = default_shell();
+ char_u *cmd_shell = mch_getenv("COMSPEC");
+
+ if (cmd_shell == NULL || *cmd_shell == NUL)
+ cmd_shell = default_shell();
subcmd = vim_strsave_escaped_ext(cmdbase, "|", '^', FALSE);
if (subcmd != NULL)
{
/* make "cmd.exe /c arguments" */
cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
- vim_free(subcmd);
-
newcmd = lalloc(cmdlen, TRUE);
if (newcmd != NULL)
vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
- default_shell, subcmd);
+ cmd_shell, subcmd);
else
newcmd = cmdbase;
+ vim_free(subcmd);
}
}