[PATCH] iconv: do not report error exit with transliteration [BZ #32448]
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 14 Dec 2024 10:44:11 +0000 (11:44 +0100)
committerAurelien Jarno <aurel32@debian.org>
Fri, 3 Jan 2025 10:56:38 +0000 (11:56 +0100)
commitcfcf17141eeaee2e4cd365db2bff1d7b9a4fd3a3
treeb609ac63077bd2b6e9170a5f7305bf0123c167d5
parent1559656a3b87a1750d70c269dacc047b3e170e07
[PATCH] iconv: do not report error exit with transliteration [BZ #32448]

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. At the same time
also fix the typo outself -> ourselves.

Fixes: 6cbf845fcdc7
Resolves: BZ #32448
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Gbp-Pq: Topic any
Gbp-Pq: Name git-iconv-do-not-report-error-exit-with-transliteration-.patch
iconv/loop.c
iconv/tst-iconv_prog.sh