(mule_strlen): Fix problem in character-indexing emacsen.
authortomo <tomo>
Tue, 1 Feb 2000 02:36:25 +0000 (02:36 +0000)
committertomo <tomo>
Tue, 1 Feb 2000 02:36:25 +0000 (02:36 +0000)
canna.c

diff --git a/canna.c b/canna.c
index 300e5c8..f5ce4d1 100644 (file)
--- a/canna.c
+++ b/canna.c
  */
 
 #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 <stdio.h>
@@ -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 {