Commit 369e1d74 by Tom Tromey Committed by Tom Tromey

natIconv.cc (read): Handle EINVAL and E2BIG correctly.

	* gnu/gcj/convert/natIconv.cc (read): Handle EINVAL and E2BIG
	correctly.

From-SVN: r44928
parent 44ce0063
2001-08-15 Tom Tromey <tromey@redhat.com>
* gnu/gcj/convert/natIconv.cc (read): Handle EINVAL and E2BIG
correctly.
2001-08-09 Tom Tromey <tromey@redhat.com> 2001-08-09 Tom Tromey <tromey@redhat.com>
* java/awt/image/SampleModel.java (getPixel): Set correct array * java/awt/image/SampleModel.java (getPixel): Set correct array
......
...@@ -90,10 +90,13 @@ gnu::gcj::convert::Input_iconv::read (jcharArray outbuffer, ...@@ -90,10 +90,13 @@ gnu::gcj::convert::Input_iconv::read (jcharArray outbuffer,
if (r == (size_t) -1) if (r == (size_t) -1)
{ {
// Incomplete character. // If we see EINVAL then there is an incomplete sequence at the
if (errno == EINVAL || errno == E2BIG) // end of the input buffer. If we see E2BIG then we ran out of
return 0; // space in the output buffer. However, in both these cases
throw new java::io::CharConversionException (); // some conversion might have taken place. So we fall through
// to the normal case.
if (errno != EINVAL && errno != E2BIG)
throw new java::io::CharConversionException ();
} }
if (iconv_byte_swap) if (iconv_byte_swap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment