public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] iconv: restore verbosity with unrecognized encoding names (bug 30694)
@ 2023-08-02 11:30 Andreas Schwab
  0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2023-08-02 11:30 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc72b6d7d818ab2868920af956d1542d03342a4d

commit fc72b6d7d818ab2868920af956d1542d03342a4d
Author: Andreas Schwab <schwab@suse.de>
Date:   Tue Aug 1 17:01:37 2023 +0200

    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.

Diff:
---
 iconv/iconv_prog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-02 11:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02 11:30 [glibc] iconv: restore verbosity with unrecognized encoding names (bug 30694) Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).