0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.2061: MS-Windows GUI: ":sh" crashes when trying to use a terminal

Problem:    MS-Windows GUI: ":sh" crashes when trying to use a terminal.
Solution:   Check for a NULL command. (Yasuhiro Matsumoto, closes #4958)
This commit is contained in:
Bram Moolenaar
2019-09-20 17:20:02 +02:00
parent bffba7f704
commit 4d5c12626c
2 changed files with 8 additions and 4 deletions

View File

@@ -4657,12 +4657,14 @@ mch_call_shell(
{ {
char_u *cmdbase = cmd; char_u *cmdbase = cmd;
if (cmdbase != NULL)
// Skip a leading quote and (. // Skip a leading quote and (.
while (*cmdbase == '"' || *cmdbase == '(') while (*cmdbase == '"' || *cmdbase == '(')
++cmdbase; ++cmdbase;
// Check the command does not begin with "start " // Check the command does not begin with "start "
if (STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5])) if (cmdbase == NULL
|| STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5]))
{ {
// Use a terminal window to run the command in. // Use a terminal window to run the command in.
x = mch_call_shell_terminal(cmd, options); x = mch_call_shell_terminal(cmd, options);

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2061,
/**/ /**/
2060, 2060,
/**/ /**/