From 0ca427cf75c155e549ad2748d25a99b86c081acf Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 29 Nov 2008 10:15:38 +0000 Subject: [PATCH] *** empty log message *** --- Common/Options.cpp | 3 +++ Fltk/GUI.cpp | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index 1841086446..5ac555ec77 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -103,6 +103,9 @@ static void Print_StringOptions(int num, int level, int diff, int help, if(file) fprintf(file, "%s\n", tmp); else{ + // remove \n, \t, \r + for(int i = 0; i < strlen(tmp); i++) + if(tmp[i] == '\n' || tmp[i] == '\t' || tmp[i] == '\r') tmp[i] = ' '; // 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); diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 356d4323d6..0fc846c4d8 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -4285,11 +4285,7 @@ void GUI::create_message_window(bool redraw_only) void GUI::add_message(const char *msg) { - // remove \n, \t, \r - 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); + msg_browser->add(msg, 0); if(CTX.msg_auto_scroll) msg_browser->bottomline(msg_browser->size()); } -- GitLab