summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2021-12-09 22:37:57 +0100
committerMatthias Melcher <git@matthiasm.com>2021-12-09 22:38:04 +0100
commita4b6175dbe4f613a690a09ad90b8df599e279bf5 (patch)
tree6531b553af3e825e5e9242a5d9e4391b735f1865 /fluid
parentc175d1276df0c3c96799e57ed20535e547416757 (diff)
STR 3210: be smarter about appending ';' in callbacks
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Menu_Type.cxx2
-rw-r--r--fluid/Fl_Widget_Type.cxx2
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();