0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -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;
// Skip a leading quote and (.
while (*cmdbase == '"' || *cmdbase == '(')
++cmdbase;
if (cmdbase != NULL)
// Skip a leading quote and (.
while (*cmdbase == '"' || *cmdbase == '(')
++cmdbase;
// 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.
x = mch_call_shell_terminal(cmd, options);