From: handa Date: Tue, 21 Dec 2004 07:14:39 +0000 (+0000) Subject: (integer_value): Fix typo ('>' -> '<') and calculation of length X-Git-Tag: REL-1-2-0~34 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6eae87c765653f7decc2f8c145234eec1d91a16e;p=m17n%2Fm17n-lib.git (integer_value): Fix typo ('>' -> '<') and calculation of length of preedit text. --- diff --git a/src/input.c b/src/input.c index 4faac92..9f738ab 100644 --- a/src/input.c +++ b/src/input.c @@ -239,7 +239,7 @@ integer_value (MInputContext *ic, MPlist *arg) MInputContextInfo *ic_info = (MInputContextInfo *) ic->info; int code; MText *preedit = ic->preedit; - int len = mtext_nbytes (preedit); + int len = mtext_nchars (preedit); if (MPLIST_INTEGER_P (arg)) return MPLIST_INTEGER (arg); @@ -256,7 +256,7 @@ integer_value (MInputContext *ic, MPlist *arg) code = ic->cursor_pos + 1; else if (code == '<') code = 0; - else if (code == '<') + else if (code == '>') code = len; return (code >= 0 && code < len ? mtext_ref_char (preedit, code) : -1); }