]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/glibc-2.38/0021-iconv-restore-verbosity-with-unrecognized-encoding-n.patch
glibc: Import patches from upstream
[ipfire-2.x.git] / src / patches / glibc-2.38 / 0021-iconv-restore-verbosity-with-unrecognized-encoding-n.patch
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/27] iconv: restore verbosity with unrecognized encoding
5 names (bug 30694)
6
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.
11
12 (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)
13 ---
14 iconv/iconv_prog.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
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[])
22
23 if (res != __GCONV_OK)
24 {
25 - if (errno == EINVAL)
26 + if (res == __GCONV_NOCONV || res == __GCONV_NODB)
27 {
28 /* Try to be nice with the user and tell her which of the
29 two encoding names is wrong. This is possible because
30 --
31 2.39.2
32