diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-28 16:22:49 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-28 16:22:49 -0500 |
commit | 238f3ecc526600d5c18fead7820469719027b07c (patch) | |
tree | d84cd6606be4a81e32f8f0634aeb924b0457e5f8 /menu.c | |
parent | 5b90057859cd38b284573460460ab27bd108aa0e (diff) |
got file selector to behave better
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -60,12 +60,14 @@ static void menu_update(Ted *ted, Menu menu) { case POPUP_NONE: // no option selected break; - case POPUP_YES: + case POPUP_YES: { // overwrite it! - if (ted->prev_active_buffer) - buffer_save_as(ted->prev_active_buffer, ted->warn_overwrite); + TextBuffer *buffer = ted->prev_active_buffer; + if (buffer) { + buffer_save_as(buffer, ted->warn_overwrite); + } menu_close(ted, true); - break; + } break; case POPUP_NO: // back to the file selector *ted->warn_overwrite = '\0'; |