Mercurial > vim
comparison src/os_win32.c @ 18133:d683b2c82c00 v8.1.2061
patch 8.1.2061: MS-Windows GUI: ":sh" crashes when trying to use a terminal
Commit: https://github.com/vim/vim/commit/4d5c12626c98df23e1a5d953692d946310ddfa9c
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 20 17:20:02 2019 +0200
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 https://github.com/vim/vim/issues/4958)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Sep 2019 17:30:03 +0200 |
parents | 8b4f9be5db73 |
children | 59bc3cd42cf5 |
comparison
equal
deleted
inserted
replaced
18132:40c7235ea582 | 18133:d683b2c82c00 |
---|---|
4655 vim_strchr(p_go, GO_TERMINAL) != NULL | 4655 vim_strchr(p_go, GO_TERMINAL) != NULL |
4656 && (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0) | 4656 && (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0) |
4657 { | 4657 { |
4658 char_u *cmdbase = cmd; | 4658 char_u *cmdbase = cmd; |
4659 | 4659 |
4660 // Skip a leading quote and (. | 4660 if (cmdbase != NULL) |
4661 while (*cmdbase == '"' || *cmdbase == '(') | 4661 // Skip a leading quote and (. |
4662 ++cmdbase; | 4662 while (*cmdbase == '"' || *cmdbase == '(') |
4663 ++cmdbase; | |
4663 | 4664 |
4664 // Check the command does not begin with "start " | 4665 // Check the command does not begin with "start " |
4665 if (STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5])) | 4666 if (cmdbase == NULL |
4667 || STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5])) | |
4666 { | 4668 { |
4667 // Use a terminal window to run the command in. | 4669 // Use a terminal window to run the command in. |
4668 x = mch_call_shell_terminal(cmd, options); | 4670 x = mch_call_shell_terminal(cmd, options); |
4669 # ifdef FEAT_TITLE | 4671 # ifdef FEAT_TITLE |
4670 resettitle(); | 4672 resettitle(); |