summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-28 16:22:49 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-28 16:22:49 -0500
commit238f3ecc526600d5c18fead7820469719027b07c (patch)
treed84cd6606be4a81e32f8f0634aeb924b0457e5f8 /menu.c
parent5b90057859cd38b284573460460ab27bd108aa0e (diff)
got file selector to behave better
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c10
1 files changed, 6 insertions, 4 deletions
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';