PR 3426 fix
Tom Tromey
tromey@redhat.com
Tue Jul 17 17:08:00 GMT 2001
>>>>> "Tony" == Tony Kimball <alk@pobox.com> writes:
Tony> The patch (already applied now) in
Tony> http://gcc.gnu.org/ml/java-patches/2001-q3/msg00060.html
Tony> could use a little more tidying up:
Thanks.
Tony> if (r == (size_t) -1)
Tony> {
Tony> // Incomplete character.
Tony> if (errno == EINVAL)
Tony> return 0;
Tony> - throw new java::io::CharConversionException ();
Tony> + if (errno != E2BIG)
Tony> + throw new java::io::CharConversionException ();
Tony> }
I don't think this is the right thing to do.
I went and read the libc docs on iconv. Now I think the right code
should look like this:
if (errno == EINVAL || errno == E2BIG)
return 0;
The idea is that we throw an exception for EBADF (shouldn't happen) or
EILSEQ (invalid sequence).
Hmm... a comment later on says that glibc 2.1.3 doesn't correctly set
errno. Not sure what to do about that.
What do you think?
Tom
More information about the Java-patches
mailing list