[PATCH] iconv: do not report error exit with transliteration [BZ #32448]
Aurelien Jarno
aurelien@aurel32.net
Mon Dec 16 20:34:43 GMT 2024
On 2024-12-16 12:54, Florian Weimer wrote:
> * Aurelien Jarno:
>
> > Commit 6cbf845fcdc7 ("iconv: Preserve iconv -c error exit on invalid
> > inputs (bug 32046)") changed the error exit code to report an error when
> > an input character has been transliterated. This looks like a bug as the
> > moto in the iconv program is to report an error code in the same
> > condition as the iconv() function.
> >
> > This happens because the STANDARD_TO_LOOP_ERR_HANDLER macro sets a
> > default value for result and later updates it if the transliteration
> > succeed. With the changes, setting the default value also marks the
> > input as illegal.
> >
> > Fix that by setting up the default value of result only when the
> > transliteration is not used. This works because __gconv_transliterate()
> > calls __gconv_mark_illegal_input() to return an error.
> >
> > Fixes: 6cbf845fcdc7
> > Resolves: BZ #32448
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
>
> Looks okay to me as well.
>
> Aurelien, could you commit this?
>
Thanks, I have just committed it.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
More information about the Libc-alpha
mailing list