]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - catgets/gencat.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / catgets / gencat.c
index 18bf3bbb7f79e9359243761e0f98507e34e5e4ef..7e9682e83af2f1d0522f2433790ae1e99755e51d 100644 (file)
@@ -1,24 +1,22 @@
-/* Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 1996.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 of the License, or
+   (at your option) any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include <argp.h>
@@ -139,10 +137,7 @@ static struct argp argp =
 
 
 /* Wrapper functions with error checking for standard functions.  */
-extern void *xmalloc (size_t n);
-extern void *xcalloc (size_t n, size_t s);
-extern void *xrealloc (void *o, size_t n);
-extern char *xstrdup (const char *);
+#include <programs/xmalloc.h>
 
 /* Prototypes for local functions.  */
 static void error_print (void);
@@ -226,12 +221,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 ("\
-Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n"));
+      if (asprintf (&tp, gettext ("\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO) < 0)
+       return NULL;
+      return tp;
     default:
       break;
     }
@@ -242,12 +241,12 @@ Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n"));
 static void
 print_version (FILE *stream, struct argp_state *state)
 {
-  fprintf (stream, "gencat (GNU %s) %s\n", PACKAGE, VERSION);
+  fprintf (stream, "gencat %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\
-"), "2003");
+"), "2017");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
@@ -255,7 +254,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 /* The address of this function will be assigned to the hook in the
    error functions.  */
 static void
-error_print ()
+error_print (void)
 {
   /* We don't want the program name to be printed in messages.  Emacs'
      compile.el does not like this.  */
@@ -343,10 +342,10 @@ read_input_file (struct catalog *current, const char *fname)
                      continued = !continued;
                    }
                  while (temp_act_len > 0 && buf[temp_act_len - 1] == '\\');
-               }
 
-             if (continued)
-               --act_len;
+                 if (continued)
+                   --act_len;
+               }
            }
 
          /* Append to currently selected line.  */
@@ -467,7 +466,6 @@ this is the first definition"));
          else if (strncmp (&this_line[1], "delset", 6) == 0)
            {
              int cnt = sizeof ("delset");
-             size_t set_number;
              while (isspace (this_line[cnt]))
                ++cnt;
 
@@ -489,11 +487,8 @@ this is the first definition"));
                    ++cnt;
 
                  if (cnt == start)
-                   {
-                     error_at_line (0, 0, fname, start_line,
-                                    gettext ("illegal set number"));
-                     set_number = 0;
-                   }
+                   error_at_line (0, 0, fname, start_line,
+                                  gettext ("illegal set number"));
                  else
                    {
                      const char *symbol;
@@ -506,7 +501,6 @@ this is the first definition"));
                      /* We have a symbolic set name.  This name must
                         appear somewhere else in the catalogs read so
                         far.  */
-                     set_number = 0;
                      for (runp = current->all_sets; runp != NULL;
                           runp = runp->next)
                        {
@@ -657,12 +651,10 @@ this is the first definition"));
          else if (ident[0] != '\0')
            {
              struct message_list *runp;
-             struct message_list *lastp;
 
              /* Test whether the symbolic name was not used for
                 another message in this message set.  */
              runp = current->current_set->messages;
-             lastp = NULL;
              while (runp != NULL)
                if (runp->symbol != NULL && strcmp (ident, runp->symbol) == 0)
                  break;