Skip to content

Commit 5a15b6a

Browse files
committed
patch 8.0.0706: crash when cancelling the cmdline window in Ex mode
Problem: Crash when cancelling the cmdline window in Ex mode. (James McCoy) Solution: Do not set cmdbuff to NULL, make it empty.
1 parent cae24be commit 5a15b6a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ex_getln.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7042,7 +7042,13 @@ open_cmdwin(void)
70427042
else
70437043
ccline.cmdbuff = vim_strsave(ml_get_curline());
70447044
if (ccline.cmdbuff == NULL)
7045+
{
7046+
ccline.cmdbuff = vim_strsave((char_u *)"");
7047+
ccline.cmdlen = 0;
7048+
ccline.cmdbufflen = 1;
7049+
ccline.cmdpos = 0;
70457050
cmdwin_result = Ctrl_C;
7051+
}
70467052
else
70477053
{
70487054
ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
706,
767769
/**/
768770
705,
769771
/**/

0 commit comments

Comments
 (0)