Takuro Ashie
makei****@users*****
2006年 11月 27日 (月) 11:20:51 JST
Index: tomoe/lib/tomoe-dict.c diff -u tomoe/lib/tomoe-dict.c:1.86 tomoe/lib/tomoe-dict.c:1.87 --- tomoe/lib/tomoe-dict.c:1.86 Mon Nov 27 11:02:57 2006 +++ tomoe/lib/tomoe-dict.c Mon Nov 27 11:20:51 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.86 2006/11/27 02:02:57 kous Exp $ + * $Id: tomoe-dict.c,v 1.87 2006/11/27 02:20:51 makeinu Exp $ */ #include <stdio.h> @@ -603,20 +603,21 @@ gpointer user_data, GError **error) { -#warning FIXME: need error check - ParseData *data = user_data; - if (data->in_literal && data->chr) { + if (data->in_literal) { + g_return_if_fail (data->chr); tomoe_char_set_code (data->chr, text); return; } /* FIXME! */ - if (data->in_stroke && data->chr) { + if (data->in_stroke) { const gchar *p = text; guint point_num = 0, k; + g_return_if_fail (data->chr); + /* count stroke points */ for (; *p; p++) if (*p == '(') @@ -637,9 +638,11 @@ } } - if (data->in_reading && data->chr) { + if (data->in_reading) { TomoeReading *reading; + g_return_if_fail (data->chr); + #warning FIXME: detect reading type? reading = tomoe_reading_new (TOMOE_READING_INVALID, text); tomoe_char_add_reading (data->chr, reading); @@ -647,6 +650,8 @@ } if (data->in_meta && data->chr) { + g_return_if_fail (data->chr); + g_free (data->value); data->value = g_strdup (text); } @@ -704,6 +709,7 @@ data.in_stroke = FALSE; data.in_readings = FALSE; data.in_reading = FALSE; + data.in_meta = FALSE; data.chr = NULL; data.writing = NULL; data.key = NULL;