about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2023-08-01 17:01:37 +0200
committerAndreas Schwab <schwab@suse.de>2023-08-02 13:30:04 +0200
commitfc72b6d7d818ab2868920af956d1542d03342a4d (patch)
treeb5f046d36b785e835d3948d67144e2df624186b4
parent78ceef25d64efeeb6067d1cb282a00466e637e2a (diff)
downloadglibc-fc72b6d7d818ab2868920af956d1542d03342a4d.tar.gz
glibc-fc72b6d7d818ab2868920af956d1542d03342a4d.tar.xz
glibc-fc72b6d7d818ab2868920af956d1542d03342a4d.zip
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.
-rw-r--r--iconv/iconv_prog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index bee898c63c..cf32cf9b44 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -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