[Tomoe-cvs 1110] CVS update: tomoe/lib

Back to archive index

Takuro Ashie makei****@users*****
2006年 11月 27日 (月) 14:05:28 JST


Index: tomoe/lib/tomoe-dict.c
diff -u tomoe/lib/tomoe-dict.c:1.93 tomoe/lib/tomoe-dict.c:1.94
--- tomoe/lib/tomoe-dict.c:1.93	Mon Nov 27 13:49:57 2006
+++ tomoe/lib/tomoe-dict.c	Mon Nov 27 14:05:28 2006
@@ -21,7 +21,7 @@
  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *  Boston, MA  02111-1307  USA
  *
- *  $Id: tomoe-dict.c,v 1.93 2006/11/27 04:49:57 ikezoe Exp $
+ *  $Id: tomoe-dict.c,v 1.94 2006/11/27 05:05:28 makeinu Exp $
  */
 
 #include <stdio.h>
@@ -860,11 +860,17 @@
     g_return_if_fail (f);
 
     /* write the header */
-    head = g_markup_printf_escaped (
+    head = g_strdup (
         "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
-        "<!DOCTYPE dictionary SYSTEM \"tomoe-dict.dtd\">\n"
-        "<dictionary name=\"%s\">\n",
-        priv->name);
+        "<!DOCTYPE dictionary SYSTEM \"tomoe-dict.dtd\">\n");
+    if (fwrite (head, strlen (head), 1, f) < 1) goto ERROR;
+    g_free (head);
+
+    if (priv->name)
+        head = g_markup_printf_escaped ("<dictionary name=\"%s\">\n",
+                                        priv->name);
+    else
+        head = g_strdup ("<dictionary>\n");
     if (fwrite (head, strlen (head), 1, f) < 1) goto ERROR;
 
     /* write each characters */


tomoe-cvs メーリングリストの案内
Back to archive index