public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andreas K. Huttel <dilfridge@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/release/2.38/master] iconv: restore verbosity with unrecognized encoding names (bug 30694)
Date: Fri, 15 Sep 2023 22:03:09 +0000 (GMT)	[thread overview]
Message-ID: <20230915220309.C22753858C52@sourceware.org> (raw)

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

commit 63250e9c571314b6daa2c949ea0af335ee766751
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.
    
    (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)

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

                 reply	other threads:[~2023-09-15 22:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230915220309.C22753858C52@sourceware.org \
    --to=dilfridge@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).