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:
@@ -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);
|
||||||
|
@@ -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,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user