Mercurial > vim
comparison src/term.c @ 16586:5ebb2c87d1f5 v8.1.1296
patch 8.1.1296: crash when using invalid command line argument
commit https://github.com/vim/vim/commit/27821260c0afaac85cb1c10627f1d7fbe48860ae
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 8 16:41:09 2019 +0200
patch 8.1.1296: crash when using invalid command line argument
Problem: Crash when using invalid command line argument.
Solution: Check for options not being initialized.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 08 May 2019 16:45:07 +0200 |
parents | a72ad8a8b249 |
children | d4e74f9f7ae9 |
comparison
equal
deleted
inserted
replaced
16585:f7b1c58bcf8b | 16586:5ebb2c87d1f5 |
---|---|
3012 * popped (restored) later. | 3012 * popped (restored) later. |
3013 */ | 3013 */ |
3014 void | 3014 void |
3015 term_push_title(int which) | 3015 term_push_title(int which) |
3016 { | 3016 { |
3017 if ((which & SAVE_RESTORE_TITLE) && *T_CST != NUL) | 3017 if ((which & SAVE_RESTORE_TITLE) && T_CST != NULL && *T_CST != NUL) |
3018 { | 3018 { |
3019 OUT_STR(T_CST); | 3019 OUT_STR(T_CST); |
3020 out_flush(); | 3020 out_flush(); |
3021 } | 3021 } |
3022 | 3022 |
3023 if ((which & SAVE_RESTORE_ICON) && *T_SSI != NUL) | 3023 if ((which & SAVE_RESTORE_ICON) && T_SSI != NULL && *T_SSI != NUL) |
3024 { | 3024 { |
3025 OUT_STR(T_SSI); | 3025 OUT_STR(T_SSI); |
3026 out_flush(); | 3026 out_flush(); |
3027 } | 3027 } |
3028 } | 3028 } |
3031 * Tell the terminal to pop the title and/or icon. | 3031 * Tell the terminal to pop the title and/or icon. |
3032 */ | 3032 */ |
3033 void | 3033 void |
3034 term_pop_title(int which) | 3034 term_pop_title(int which) |
3035 { | 3035 { |
3036 if ((which & SAVE_RESTORE_TITLE) && *T_CRT != NUL) | 3036 if ((which & SAVE_RESTORE_TITLE) && T_CRT != NULL && *T_CRT != NUL) |
3037 { | 3037 { |
3038 OUT_STR(T_CRT); | 3038 OUT_STR(T_CRT); |
3039 out_flush(); | 3039 out_flush(); |
3040 } | 3040 } |
3041 | 3041 |
3042 if ((which & SAVE_RESTORE_ICON) && *T_SRI != NUL) | 3042 if ((which & SAVE_RESTORE_ICON) && T_SRI != NULL && *T_SRI != NUL) |
3043 { | 3043 { |
3044 OUT_STR(T_SRI); | 3044 OUT_STR(T_SRI); |
3045 out_flush(); | 3045 out_flush(); |
3046 } | 3046 } |
3047 } | 3047 } |