Hi,

I committed the attached patch.

Regards,
Jeroen

2007-02-04  Jeroen Frijters  <[EMAIL PROTECTED]>

        Fix for #30693
        * gnu/java/nio/charset/ByteCharset.java
        (ByteCharset.Decoder.decodeLoop): Reset input buffer position if
        the byte read was unmappable.
Index: gnu/java/nio/charset/ByteCharset.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/ByteCharset.java,v
retrieving revision 1.5
diff -u -r1.5 ByteCharset.java
--- gnu/java/nio/charset/ByteCharset.java       21 Dec 2006 13:02:51 -0000      
1.5
+++ gnu/java/nio/charset/ByteCharset.java       4 Feb 2007 09:36:14 -0000
@@ -116,7 +116,10 @@
           }
        
        if((c = lookup[(int) (b & 0xFF)]) == NONE)
-          return CoderResult.unmappableForLength (1);
+          {
+            in.position (in.position () - 1);
+            return CoderResult.unmappableForLength (1);
+          }
         out.put (c);
       }
 

Reply via email to