]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unisetspan.cpp
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / common / unisetspan.cpp
index 90a9fc47497a146ab9ee52e9f78918a60c7c5a62..e107abe545226d11fd681ef4830e123dd1ad5572 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2007-2011, International Business Machines
+*   Copyright (C) 2007-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -503,9 +503,9 @@ spanOneUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) {
     if((int8_t)c>=0) {
         return set.contains(c) ? 1 : -1;
     }
     if((int8_t)c>=0) {
         return set.contains(c) ? 1 : -1;
     }
-    // Take advantage of non-ASCII fastpaths in U8_NEXT().
+    // Take advantage of non-ASCII fastpaths in U8_NEXT_OR_FFFD().
     int32_t i=0;
     int32_t i=0;
-    U8_NEXT(s, i, length, c);
+    U8_NEXT_OR_FFFD(s, i, length, c);
     return set.contains(c) ? i : -i;
 }
 
     return set.contains(c) ? i : -i;
 }
 
@@ -516,7 +516,7 @@ spanOneBackUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) {
         return set.contains(c) ? 1 : -1;
     }
     int32_t i=length-1;
         return set.contains(c) ? 1 : -1;
     }
     int32_t i=length-1;
-    c=utf8_prevCharSafeBody(s, 0, &i, c, -1);
+    c=utf8_prevCharSafeBody(s, 0, &i, c, -3);
     length-=i;
     return set.contains(c) ? length : -length;
 }
     length-=i;
     return set.contains(c) ? length : -length;
 }