]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - iconv/iconv_prog.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / iconv / iconv_prog.c
index 36168a1a919f4ca66c800b4580f9969e93f70db2..4fb3f86efddb139cdc623b99618b7bc44fa3123d 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert text in given files from the specified from-set to the to-set.
-   Copyright (C) 1998-2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 1998-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -57,13 +57,13 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
 static const struct argp_option options[] =
 {
   { NULL, 0, NULL, 0, N_("Input/Output format specification:") },
-  { "from-code", 'f', "NAME", 0, N_("encoding of original text") },
-  { "to-code", 't', "NAME", 0, N_("encoding for output") },
+  { "from-code", 'f', N_("NAME"), 0, N_("encoding of original text") },
+  { "to-code", 't', N_("NAME"), 0, N_("encoding for output") },
   { NULL, 0, NULL, 0, N_("Information:") },
   { "list", 'l', NULL, 0, N_("list all known coded character sets") },
   { NULL, 0, NULL, 0, N_("Output control:") },
   { NULL, 'c', NULL, 0, N_("omit invalid characters from output") },
-  { "output", 'o', "FILE", 0, N_("output file") },
+  { "output", 'o', N_("FILE"), 0, N_("output file") },
   { "silent", 's', NULL, 0, N_("suppress warnings") },
   { "verbose", OPT_VERBOSE, NULL, 0, N_("print progress information") },
   { NULL, 0, NULL, 0, NULL }
@@ -155,7 +155,7 @@ main (int argc, char *argv[])
       if (*errhand == '/')
        {
          --nslash;
-         errhand = strchrnul (errhand, '/');
+         errhand = strchrnul (errhand + 1, '/');
 
          if (*errhand == '/')
            {
@@ -275,7 +275,7 @@ conversions from `%s' and to `%s' are not supported"),
        do
          {
 #ifdef _POSIX_MAPPED_FILES
-           struct stat st;
+           struct stat64 st;
            char *addr;
 #endif
            int fd, ret;
@@ -300,7 +300,7 @@ conversions from `%s' and to `%s' are not supported"),
 #ifdef _POSIX_MAPPED_FILES
            /* We have possibilities for reading the input file.  First try
               to mmap() it since this will provide the fastest solution.  */
-           if (fstat (fd, &st) == 0
+           if (fstat64 (fd, &st) == 0
                && ((addr = mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE,
                                  fd, 0)) != MAP_FAILED))
              {
@@ -400,13 +400,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
 static char *
 more_help (int key, const char *text, void *input)
 {
+  char *tp = NULL;
   switch (key)
     {
     case ARGP_KEY_HELP_EXTRA:
       /* We print some extra information.  */
-      return strdup (gettext ("\
+      if (asprintf (&tp, gettext ("\
 For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+       return NULL;
+      return tp;
     default:
       break;
     }
@@ -418,12 +421,12 @@ For bug reporting instructions, please see:\n\
 static void
 print_version (FILE *stream, struct argp_state *state)
 {
-  fprintf (stream, "iconv (GNU %s) %s\n", PACKAGE, VERSION);
+  fprintf (stream, "iconv %s%s\n", PKGVERSION, VERSION);
   fprintf (stream, gettext ("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
+"), "2014");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
@@ -786,7 +789,7 @@ print_known_names (void)
 
   if (human_readable)
     fputs (_("\
-The following list contain all the coded character sets known.  This does\n\
+The following list contains all the coded character sets known.  This does\n\
 not necessarily mean that all combinations of these names can be used for\n\
 the FROM and TO command line parameters.  One coded character set can be\n\
 listed with several different names (aliases).\n\n  "), stdout);