This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PR 3426 fix


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]