]> granicus.if.org Git - icu/commitdiff
ICU-8660 Skip the current source char when searching for the next escape character
authorMichael Ow <mow@svn.icu-project.org>
Fri, 8 Jul 2011 17:22:34 +0000 (17:22 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Fri, 8 Jul 2011 17:22:34 +0000 (17:22 +0000)
X-SVN-Rev: 30297

icu4j/main/classes/charset/src/com/ibm/icu/charset/CharsetCompoundText.java

index 8e62234e12acbba983c9a7d395f56841d1950e94..d0647915160ff9fc0a162c2ab7931d01ac9c433d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2010, International Business Machines Corporation and         *
+ * Copyright (C) 2010-2011, International Business Machines Corporation and         *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -200,12 +200,12 @@ class CharsetCompoundText extends CharsetICU {
     
     private static int findNextEsc(ByteBuffer source) {
         int sourceLimit = source.limit();
-        for (int i = source.position(); i < sourceLimit; i++) {
+        for (int i = (source.position() + 1); i < sourceLimit; i++) {
             if (source.get(i) == 0x1B) {
                 return i;
             }
         }
-        return source.limit();
+        return sourceLimit;
     }
     
     private static byte getState(int codepoint) {