diff options
author | Andreas Schwab <schwab@suse.de> | 2023-08-01 17:01:37 +0200 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2023-09-15 23:55:01 +0200 |
commit | 63250e9c571314b6daa2c949ea0af335ee766751 (patch) | |
tree | 20cc7d179156bdd00b55d37d209e31f54a07effb | |
parent | 00ae4f10b504bc4564e9f22f00907093f1ab9338 (diff) | |
download | glibc-63250e9c571314b6daa2c949ea0af335ee766751.tar.gz glibc-63250e9c571314b6daa2c949ea0af335ee766751.tar.xz glibc-63250e9c571314b6daa2c949ea0af335ee766751.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. (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)
-rw-r--r-- | iconv/iconv_prog.c | 2 |
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 |