Mercurial > vim
comparison src/os_unix.c @ 16511:4182f74e2965 v8.1.1259
patch 8.1.1259: crash when exiting early
commit https://github.com/vim/vim/commit/e5c83286bb9a72cc686f2826e605eddebe3c730c
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 3 23:15:37 2019 +0200
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 https://github.com/vim/vim/issues/4334)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 May 2019 23:30:05 +0200 |
parents | 42910f306377 |
children | a72ad8a8b249 |
comparison
equal
deleted
inserted
replaced
16510:816e05c23ddc | 16511:4182f74e2965 |
---|---|
2203 * SAVE_RESTORE_BOTH restore title and icon | 2203 * SAVE_RESTORE_BOTH restore title and icon |
2204 */ | 2204 */ |
2205 void | 2205 void |
2206 mch_restore_title(int which) | 2206 mch_restore_title(int which) |
2207 { | 2207 { |
2208 int do_push_pop = did_set_title || did_set_icon; | |
2209 | |
2208 /* only restore the title or icon when it has been set */ | 2210 /* only restore the title or icon when it has been set */ |
2209 mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ? | 2211 mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ? |
2210 (oldtitle ? oldtitle : p_titleold) : NULL, | 2212 (oldtitle ? oldtitle : p_titleold) : NULL, |
2211 ((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL); | 2213 ((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL); |
2212 | 2214 |
2213 // pop and push from/to the stack | 2215 if (do_push_pop) |
2214 term_pop_title(which); | 2216 { |
2215 term_push_title(which); | 2217 // pop and push from/to the stack |
2218 term_pop_title(which); | |
2219 term_push_title(which); | |
2220 } | |
2216 } | 2221 } |
2217 | 2222 |
2218 #endif /* FEAT_TITLE */ | 2223 #endif /* FEAT_TITLE */ |
2219 | 2224 |
2220 /* | 2225 /* |