From 238f3ecc526600d5c18fead7820469719027b07c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Thu, 28 Jan 2021 16:22:49 -0500 Subject: got file selector to behave better --- menu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index 68f941a..3013920 100644 --- a/menu.c +++ b/menu.c @@ -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'; -- cgit v1.2.3