]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
iconv: restore verbosity with unrecognized encoding names (bug 30694)
authorAndreas Schwab <schwab@suse.de>
Tue, 1 Aug 2023 15:01:37 +0000 (17:01 +0200)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Fri, 15 Sep 2023 21:55:01 +0000 (23:55 +0200)
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.

(cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)

iconv/iconv_prog.c

index bee898c63c603da6132a50f30e34b87a32e1fc29..cf32cf9b44b208e2df0bec30bf0edd4941dfa657 100644 (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