From: tomo Date: Tue, 1 Feb 2000 02:36:25 +0000 (+0000) Subject: (mule_strlen): Fix problem in character-indexing emacsen. X-Git-Tag: emacs-canna-1_4~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd33bc65f037e71e27c96cb75c70e79d011b3fc8;p=elisp%2Femacs-canna.git (mule_strlen): Fix problem in character-indexing emacsen. --- diff --git a/canna.c b/canna.c index 300e5c8..f5ce4d1 100644 --- a/canna.c +++ b/canna.c @@ -143,7 +143,7 @@ */ #ifndef lint -static char rcs_id[] = "$Id: canna.c,v 1.36 1999-03-02 18:52:41 morioka Exp $"; +static char rcs_id[] = "$Id: canna.c,v 1.37 2000-02-01 02:36:25 tomo Exp $"; #endif #include @@ -1580,15 +1580,27 @@ int l; while((cp < p + l) && (ch = *cp)) { if ((unsigned char)ch == ISO_CODE_SS2) { +#ifdef STRING_BYTES + len++; +#else len += 2; +#endif cp += 2; } else if ((unsigned char)ch == ISO_CODE_SS3) { +#ifdef STRING_BYTES + len++; +#else len += 3; +#endif cp += 3; } else if(ch & 0x80) { +#ifdef STRING_BYTES + len++; +#else len += 3; +#endif cp += 2; } else {