]> sourceware.org Git - 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 Schwab <schwab@suse.de>
Wed, 2 Aug 2023 11:30:04 +0000 (13:30 +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.

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
This page took 2.30039 seconds and 5 git commands to generate.