From a4b6175dbe4f613a690a09ad90b8df599e279bf5 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 9 Dec 2021 22:37:57 +0100 Subject: STR 3210: be smarter about appending ';' in callbacks --- fluid/Fl_Menu_Type.cxx | 2 +- fluid/Fl_Widget_Type.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 4cbef8d8f..fda611d4e 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -210,7 +210,7 @@ void Fl_Menu_Item_Type::write_static() { if (use_v) write_c(" v"); write_c(") {\n"); write_c_indented(callback()); - if (*(d-1) != ';') { + if (*(d-1) != ';' && *(d-1) != '}') { const char *p = strrchr(callback(), '\n'); if (p) p ++; else p = callback(); diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 411303508..d181b8233 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -2055,7 +2055,7 @@ void Fl_Widget_Type::write_static() { if (use_v) write_c(" v"); write_c(") {\n"); write_c_indented(callback()); - if (*(d-1) != ';') { + if (*(d-1) != ';' && *(d-1) != '}') { const char *p = strrchr(callback(), '\n'); if (p) p ++; else p = callback(); -- cgit v1.2.3