From a5f5105f20f047f2033fe37c7337047853893b10 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 17 Nov 2008 17:35:04 +0000 Subject: [PATCH] *** empty log message *** --- Common/Options.cpp | 5 ++++- Fltk/GUI.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index dc94042465..9eb6148a1f 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -102,8 +102,11 @@ static void Print_StringOptions(int num, int level, int diff, int help, help ? " // " : "", help ? s[i].help : ""); if(file) fprintf(file, "%s\n", tmp); - else + else{ + // Warning: must call Msg::Direct(level, ...) here, because + // we cannot use tmp as a format string (it can contain %s!) Msg::Direct(3, "%s", tmp); + } } } i++; diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 22911f7432..0318ce640b 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -4285,7 +4285,10 @@ void GUI::create_message_window(bool redraw_only) void GUI::add_message(const char *msg) { - msg_browser->add(msg, 0); + std::string str(msg); + for(unsigned int i = 0; i < str.size(); i++) + if(str[i] == '\n' || str[i] == '\t' || str[i] == '\r') str[i] = ' '; + msg_browser->add(str.c_str(), 0); if(CTX.msg_auto_scroll) msg_browser->bottomline(msg_browser->size()); } -- GitLab