--- embedaddon/libiconv/src/iconv.c 2012/05/29 09:29:43 1.1.1.2 +++ embedaddon/libiconv/src/iconv.c 2021/03/17 13:38:46 1.1.1.3 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2009, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2000-2009, 2011-2012, 2016-2019 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. This program is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ #include "config.h" #ifndef ICONV_CONST @@ -107,7 +107,7 @@ static void usage (int exitcode) Align it correctly against the first line. */ _("or: iconv -l"); fprintf(stderr, "%s\n%s\n", helpstring1, helpstring2); - fprintf(stderr, _("Try `%s --help' for more information.\n"), program_name); + fprintf(stderr, _("Try '%s --help' for more information.\n"), program_name); } else { /* xgettext: no-wrap */ /* TRANSLATORS: The first line of the long usage message. @@ -191,10 +191,10 @@ static void print_version (void) { printf("iconv (GNU libiconv %d.%d)\n", _libiconv_version >> 8, _libiconv_version & 0xff); - printf("Copyright (C) %s Free Software Foundation, Inc.\n", "2000-2011"); + printf("Copyright (C) %s Free Software Foundation, Inc.\n", "2000-2019"); /* xgettext: no-wrap */ fputs (_("\ -License GPLv3+: GNU GPL version 3 or later \n\ +License GPLv3+: GNU GPL version 3 or later \n\ This is free software: you are free to change and redistribute it.\n\ There is NO WARRANTY, to the extent permitted by law.\n\ "),stdout); @@ -861,6 +861,15 @@ int main (int argc, char* argv[]) bindtextdomain("libiconv",relocate(LOCALEDIR)); #endif textdomain("libiconv"); + /* No need to invoke the gnulib function stdopen() here, because + (1) the only file descriptor allocations done by this program are + fopen(...,"r"), + (2) when such fopen() calls occur, stdin is not used, + hence + - when an fopen() call happens to open fd 0, it is harmless, by (2), + - when an fopen() call happens to open fd 1 or 2, writing to + stdout or stderr will produce an error, by (1). */ + for (i = 1; i < argc;) { size_t len = strlen(argv[i]); if (!strcmp(argv[i],"--")) { @@ -959,6 +968,7 @@ int main (int argc, char* argv[]) if /* --s ... --silent */ (len >= 3 && len <= 8 && !strncmp(argv[i],"--silent",len)) { silent = 1; + i++; continue; } if /* --h ... --help */