0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1259: crash when exiting early

Problem:    Crash when exiting early. (Ralf Schandl)
Solution:   Only pop/push the title when it was set. (closes #4334)
This commit is contained in:
Bram Moolenaar
2019-05-03 23:15:37 +02:00
parent 9404a18ad9
commit e5c83286bb
5 changed files with 44 additions and 26 deletions

View File

@@ -2205,14 +2205,19 @@ mch_settitle(char_u *title, char_u *icon)
void
mch_restore_title(int which)
{
int do_push_pop = did_set_title || did_set_icon;
/* only restore the title or icon when it has been set */
mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ?
(oldtitle ? oldtitle : p_titleold) : NULL,
((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL);
// pop and push from/to the stack
term_pop_title(which);
term_push_title(which);
if (do_push_pop)
{
// pop and push from/to the stack
term_pop_title(which);
term_push_title(which);
}
}
#endif /* FEAT_TITLE */