patch 8.2.4430: GTK: crash when using 'guiligatures' and reading from stdin

Problem:    GTK: crash when using 'guiligatures' and reading from stdin.
Solution:   Make a copy of the message. (Amon Sha, closes #9719, closes #9814)
This commit is contained in:
Amon Sha
2022-02-21 15:07:12 +00:00
committed by Bram Moolenaar
parent c2f17f7e64
commit 101979358f
2 changed files with 9 additions and 2 deletions

View File

@ -759,8 +759,13 @@ readfile(
// Also write a message in the GUI window, if there is one. // Also write a message in the GUI window, if there is one.
if (gui.in_use && !gui.dying && !gui.starting) if (gui.in_use && !gui.dying && !gui.starting)
{ {
p = (char_u *)_("Reading from stdin..."); // make a copy, gui_write() may try to change it
gui_write(p, (int)STRLEN(p)); p = vim_strsave((char_u *)_("Reading from stdin..."));
if (p != NULL)
{
gui_write(p, (int)STRLEN(p));
vim_free(p);
}
} }
#endif #endif
} }

View File

@ -750,6 +750,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 */
/**/
4430,
/**/ /**/
4429, 4429,
/**/ /**/