Write empty string instead "(null) in xml.
authorPeng Huang <shawn.p.huang@gmail.com>
Sun, 27 Sep 2009 05:33:49 +0000 (13:33 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Sun, 27 Sep 2009 05:33:49 +0000 (13:33 +0800)
src/ibusenginedesc.c

index b96d8c018a58c3fa10ee4bdb2ad1e9d41b85521e..d5b4326146f42a88ace8eeb67d226604e3bf2f4a 100644 (file)
@@ -254,13 +254,13 @@ ibus_engine_desc_output (IBusEngineDesc *desc,
 {
     g_string_append_indent (output, indent);
     g_string_append (output, "<engine>\n");
-#define OUTPUT_ENTRY(field, element)                                    \
-    {                                                                   \
-        gchar *escape_text = g_markup_escape_text (desc->field, -1);    \
-        g_string_append_indent (output, indent + 1);                    \
-        g_string_append_printf (output, "<"element">%s</"element">\n",  \
-                                escape_text);                           \
-        g_free (escape_text);                                           \
+#define OUTPUT_ENTRY(field, element)                                                    \
+    {                                                                                   \
+        gchar *escape_text = g_markup_escape_text (desc->field ? desc->field : "", -1); \
+        g_string_append_indent (output, indent + 1);                                    \
+        g_string_append_printf (output, "<"element">%s</"element">\n",                  \
+                                escape_text);                                           \
+        g_free (escape_text);                                                           \
     }
 #define OUTPUT_ENTRY_1(name) OUTPUT_ENTRY(name, #name)
     OUTPUT_ENTRY_1(name);