]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-202 v7.1.202
authorBram Moolenaar <Bram@vim.org>
Fri, 4 Jan 2008 16:47:25 +0000 (16:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 4 Jan 2008 16:47:25 +0000 (16:47 +0000)
src/mbyte.c
src/version.c

index b2303fdae35dfae8ad5a4b593a924b154bdc1cba..286df5d56481bcef136a332e836c36cc4476789e 100644 (file)
@@ -1642,7 +1642,7 @@ utf_byte2len(b)
  * Get the length of UTF-8 byte sequence "p[size]".  Does not include any
  * following composing characters.
  * Returns 1 for "".
- * Returns 1 for an illegal byte sequence.
+ * Returns 1 for an illegal byte sequence (also in incomplete byte seq.).
  * Returns number > "size" for an incomplete byte sequence.
  */
     int
@@ -1652,13 +1652,14 @@ utf_ptr2len_len(p, size)
 {
     int                len;
     int                i;
+    int                m;
 
     if (*p == NUL)
        return 1;
-    len = utf8len_tab[*p];
+    m = len = utf8len_tab[*p];
     if (len > size)
-       return len;     /* incomplete byte sequence. */
-    for (i = 1; i < len; ++i)
+       m = size;       /* incomplete byte sequence. */
+    for (i = 1; i < m; ++i)
        if ((p[i] & 0xc0) != 0x80)
            return 1;
     return len;
index ce139241753a46db2b1cea409af4efeda982fa3f..864228eddd81425e3a3fe69b4bb792c6fea473cd 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    202,
 /**/
     201,
 /**/