[uim-commit] r397 - trunk/uim
ekato at freedesktop.org
ekato at freedesktop.org
Sat Jan 29 23:48:49 PST 2005
Author: ekato
Date: 2005-01-29 23:48:46 -0800 (Sat, 29 Jan 2005)
New Revision: 397
Modified:
trunk/uim/skk-dic.c
Log:
* uim/skk-dic.c (skk_eval_candidate) : Add check if
uim_scm_return_value() is empty.
Modified: trunk/uim/skk-dic.c
===================================================================
--- trunk/uim/skk-dic.c 2005-01-30 07:27:38 UTC (rev 396)
+++ trunk/uim/skk-dic.c 2005-01-30 07:48:46 UTC (rev 397)
@@ -2120,10 +2120,10 @@
static uim_lisp
skk_eval_candidate(uim_lisp str_)
{
- const char *cand, *return_val;
+ const char *cand, *evaluated_str;
char *p, *q, *str;
size_t len;
- uim_lisp cand_;
+ uim_lisp cand_, return_val;
if (str_ == uim_scm_null_list())
return uim_scm_null_list();
@@ -2150,19 +2150,24 @@
strncat(str, p + strlen("(concat"), q - (p + strlen("(concat")) + 1);
UIM_EVAL_FSTRING1(NULL, "%s", str);
- return_val = uim_scm_refer_c_str(uim_scm_return_value());
+ return_val = uim_scm_return_value();
+ if (return_val == uim_scm_null_list()) {
+ free(str);
+ return str_;
+ }
+ evaluated_str = uim_scm_refer_c_str(return_val);
/* get evaluated candidate */
- len = p - cand + strlen(return_val);
+ len = p - cand + strlen(evaluated_str);
if (len > strlen(str))
str = realloc(str, len + 1);
if (p != cand) {
strncpy(str, cand, p - cand);
str[p - cand] = '\0';
- strcat(str, return_val);
+ strcat(str, evaluated_str);
} else {
- strcpy(str, return_val);
+ strcpy(str, evaluated_str);
}
cand_ = uim_scm_make_str(str);
More information about the Uim-commit
mailing list