]> git.saurik.com Git - wxWidgets.git/commitdiff
escape '<' in strings with Pango markup
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Dec 2006 12:49:49 +0000 (12:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Dec 2006 12:49:49 +0000 (12:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/assertdlg_gtk.c

index 767f5a0158faf4b4cb248bcf70d59fb1df3bbde8..88dec90bb5f276373d28ca8384a76ebc0a93bd92 100644 (file)
@@ -438,13 +438,17 @@ gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
 
 void gtk_assert_dialog_set_message(GtkAssertDialog *dlg, const gchar *msg)
 {
-    /* prepend and append the <b> tag */
-    gchar *decorated_msg = g_strdup_printf("<b>%s</b>", msg);
+    /* prepend and append the <b> tag
+       NOTE: g_markup_printf_escaped() is not used because it's available
+             only for glib >= 2.4 */
+    gchar *escaped_msg = g_markup_escape_text (msg, -1);
+    gchar *decorated_msg = g_strdup_printf ("<b>%s</b>", escaped_msg);
 
     g_return_if_fail (GTK_IS_ASSERT_DIALOG (dlg));
     gtk_label_set_markup (GTK_LABEL(dlg->message), decorated_msg);
 
     g_free (decorated_msg);
+    g_free (escaped_msg);
 }
 
 void gtk_assert_dialog_set_backtrace_callback(GtkAssertDialog *assertdlg,