1 From 63250e9c571314b6daa2c949ea0af335ee766751 Mon Sep 17 00:00:00 2001
2 From: Andreas Schwab <schwab@suse.de>
3 Date: Tue, 1 Aug 2023 17:01:37 +0200
4 Subject: [PATCH 21/44] iconv: restore verbosity with unrecognized encoding
7 Commit 91927b7c76 ("Rewrite iconv option parsing [BZ #19519]") changed the
8 iconv program to call __gconv_open directly instead of the iconv_open
9 wrapper, but the former does not set errno. Update the caller to
10 interpret the return codes like iconv_open does.
12 (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)
14 iconv/iconv_prog.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
17 diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
18 index bee898c63c..cf32cf9b44 100644
19 --- a/iconv/iconv_prog.c
20 +++ b/iconv/iconv_prog.c
21 @@ -187,7 +187,7 @@ main (int argc, char *argv[])
23 if (res != __GCONV_OK)
25 - if (errno == EINVAL)
26 + if (res == __GCONV_NOCONV || res == __GCONV_NODB)
28 /* Try to be nice with the user and tell her which of the
29 two encoding names is wrong. This is possible because