iconv: restore verbosity with unrecognized encoding names (bug 30694)

Commit 91927b7c76 ("Rewrite iconv option parsing [BZ #19519]") changed the
iconv program to call __gconv_open directly instead of the iconv_open
wrapper, but the former does not set errno.  Update the caller to
interpret the return codes like iconv_open does.
This commit is contained in:
Andreas Schwab 2023-08-01 17:01:37 +02:00
parent 78ceef25d6
commit fc72b6d7d8

View File

@ -187,7 +187,7 @@ main (int argc, char *argv[])
if (res != __GCONV_OK)
{
if (errno == EINVAL)
if (res == __GCONV_NOCONV || res == __GCONV_NODB)
{
/* Try to be nice with the user and tell her which of the
two encoding names is wrong. This is possible because