Revision: 6855
Author: ek.kato
Date: Mon Dec 27 21:52:12 2010
Log: * Merge r6839, r6854 from trunk.

http://code.google.com/p/uim/source/detail?r=6855

Modified:
 /branches/1.6
 /branches/1.6/uim/skk.c

=======================================
--- /branches/1.6/uim/skk.c     Tue Nov 23 22:20:18 2010
+++ /branches/1.6/uim/skk.c     Mon Dec 27 21:52:12 2010
@@ -178,6 +178,7 @@
                const char *fn, int is_personal);
 static void look_get_comp(struct skk_comp_array *ca, const char *str);
 static uim_lisp look_get_top_word(const char *str);
+static char *quote_word(const char *word, const char *prefix);

 /* skkserv connection */
 #define SKK_SERV_BUFSIZ        1024
@@ -403,6 +404,13 @@

   p = uim_strdup(str);
   term = next_slash_in_bracket(p);
+
+  if (*term == '\0') {
+ /* this is not the bracket used for skk-henkan-strict-okuri-precedence */
+    free(p);
+    return NULL;
+  }
+
   *term = '\0';
   return p;
 }
@@ -628,9 +636,19 @@
     if (tmp) {
       if (tmp[0] == '[') {
        char *str = okuri_in_bracket(&tmp[1]);
-       tmp[0] = ' '; /* create first_space */
-       compose_line_parts(di, sl, str, &tmp[0]);
-       free(str);
+       if (!str) {
+         /*
+          * this is not the bracket used for
+          * skk-henkan-strict-okuri-precedence
+          */
+         char *quoted = quote_word(tmp, "(concat \"");
+         push_back_candidate_to_array(ca, quoted);
+         free(quoted);
+       } else {
+         tmp[0] = ' '; /* create first_space */
+         compose_line_parts(di, sl, str, &tmp[0]);
+         free(str);
+       }
       } else if (tmp[0] != ']') {
        push_back_candidate_to_array(ca, tmp);
       }

Reply via email to