[uim-commit] r3146 - trunk/fep

yamamoto at freedesktop.org yamamoto at freedesktop.org
Tue Feb 28 10:44:24 PST 2006


Author: yamamoto
Date: 2006-02-28 10:44:21 -0800 (Tue, 28 Feb 2006)
New Revision: 3146

Modified:
   trunk/fep/callbacks.c
Log:
* fep/callbacks.c (prop_list_update_cb) : 
  Use strwidth instead of strlen because label_width is a width of
  leaf_label.


Modified: trunk/fep/callbacks.c
===================================================================
--- trunk/fep/callbacks.c	2006-02-28 16:31:14 UTC (rev 3145)
+++ trunk/fep/callbacks.c	2006-02-28 18:44:21 UTC (rev 3146)
@@ -572,8 +572,11 @@
 
     while (str_has_prefix(line, "leaf\t")) {
       char *leaf_label = line + strlen("leaf\t");
+
+      error = TRUE;
+
       if ((leaf_label = strchr(leaf_label, '\t')) == NULL) {
-	break;
+	goto loop_end;
       }
       leaf_label++;
 
@@ -593,12 +596,16 @@
 
       error = FALSE;
 
-      label_width = strlen(leaf_label);
+      label_width = strwidth(leaf_label);
       if (label_width > max_label_width) {
         max_label_width = label_width;
       }
     }
 
+    if (error) {
+      break;
+    }
+
     label_width = strwidth(label);
     labels = realloc(labels, strlen(labels) + strlen(label) + (max_label_width - label_width) + 1);
     for (i = 0; i < (max_label_width - label_width); i++) {



More information about the uim-commit mailing list