summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-27 17:45:04 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-27 17:45:04 -0500
commit4554db338221f8fd1c7b4855b8d5bc50780815d2 (patch)
tree330e1f1130c758190c68830d7367927e9b9035a4 /menu.c
parentf02fa3b6e1f6c3b1c1325b999f101b5ca6e02558 (diff)
more warn overwrite
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/menu.c b/menu.c
index 9a326de..a307a62 100644
--- a/menu.c
+++ b/menu.c
@@ -102,9 +102,12 @@ static void menu_render(Ted *ted, Menu menu) {
glEnd();
if (*ted->warn_overwrite) {
- char body[256] = {0};
+ char const *filename = ted->warn_overwrite;
+ char title[32] = {0}, body[256] = {0};
+ char const *last_path_sep = strrchr(filename, PATH_SEPARATOR);
+ strbuf_printf(title, "Overwrite %s?", last_path_sep ? last_path_sep + 1 : filename);
strbuf_printf(body, "Are you sure you want to overwrite %s?", ted->warn_overwrite);
- popup_render(ted, "Save as...", body);
+ popup_render(ted, title, body);
return;
}