]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Revert "xgettext: Allow multiple --copyright-holder"
authorDaiki Ueno <ueno@gnu.org>
Thu, 10 Sep 2015 07:52:09 +0000 (16:52 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 10 Sep 2015 07:53:11 +0000 (16:53 +0900)
This reverts commit 15363cca838ff1d69f6e3bfbb47ecfe90c0f5000.

Now that po/Makefile.in.in supports custom header for POT files, it is
not meaningful to add a special case for multiple copyright holders.

gettext-tools/src/xgettext.c

index 2f34057ba362793e46837828cbac45de105fbac4..89d4d457c14d2f1f791a9007142d19cd8c2adb6c 100644 (file)
@@ -125,8 +125,7 @@ message_list_ty *exclude;
 static int force_po;
 
 /* Copyright holder of the output file and the translations.  */
-static const char *default_copyright_holder = "THE PACKAGE'S COPYRIGHT HOLDER";
-static char *copyright_holder = NULL;
+static const char *copyright_holder = "THE PACKAGE'S COPYRIGHT HOLDER";
 
 /* Package name.  */
 static const char *package_name = NULL;
@@ -542,19 +541,11 @@ main (int argc, char *argv[])
         break;
 
       case CHAR_MAX + 1:        /* --copyright-holder */
-        if (copyright_holder == NULL)
-          copyright_holder = xstrdup (optarg);
-        else
-          {
-            size_t total_len = strlen (copyright_holder) + 2 + strlen (optarg);
-            copyright_holder = xrealloc (copyright_holder, total_len);
-            strcat (copyright_holder, "\n");
-            strcat (copyright_holder, optarg);
-          }
+        copyright_holder = optarg;
         break;
 
       case CHAR_MAX + 2:        /* --foreign-user */
-        copyright_holder = xstrdup ("");
+        copyright_holder = "";
         break;
 
       case CHAR_MAX + 3:        /* --from-code */
@@ -3569,62 +3560,14 @@ Content-Transfer-Encoding: 8bit\n",
 
   mp = message_alloc (NULL, "", NULL, msgstr, strlen (msgstr) + 1, &pos);
 
-  if (copyright_holder == NULL)
-    copyright_holder = xstrdup (default_copyright_holder);
-
   if (copyright_holder[0] != '\0')
-    {
-      size_t copyright_comment_len;
-      char *copyright_comment;
-      const char *p;
-      char *q;
-      size_t count = 1;
-
-      p = copyright_holder;
-      while (*p != '\0')
-        {
-          p = strchr (p, '\n');
-          if (p == NULL)
-            break;
-          count++;
-          p++;
-        }
-
-      copyright_comment_len =
-        strlen (copyright_holder) + strlen ("Copyright (C) YEAR \n") * count;
-      copyright_comment = XNMALLOC (copyright_comment_len, char);
-
-      p = copyright_holder;
-      q = copyright_comment;
-      while (*p != '\0')
-        {
-          char *newline = strchr (p, '\n');
-
-          q = stpcpy (q, "Copyright (C) YEAR ");
-          if (newline != NULL)
-            {
-              *newline = '\0';
-              q = stpcpy (q, p);
-              q = stpcpy (q, "\n");
-              p = newline + 1;
-            }
-          else
-            {
-              q = stpcpy (q, p);
-              q = stpcpy (q, "\n");
-              break;
-            }
-        }
-
-      comment = xasprintf ("\
+    comment = xasprintf ("\
 SOME DESCRIPTIVE TITLE.\n\
-%s\
+Copyright (C) YEAR %s\n\
 This file is distributed under the same license as the %s package.\n\
 FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n",
-                           copyright_comment,
+                           copyright_holder,
                            package_name != NULL ? package_name : "PACKAGE");
-      free (copyright_comment);
-    }
   else
     comment = xstrdup ("\
 SOME DESCRIPTIVE TITLE.\n\
@@ -3632,7 +3575,6 @@ This file is put in the public domain.\n\
 FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n");
   message_comment_append (mp, comment);
   free (comment);
-  free (copyright_holder);
 
   mp->is_fuzzy = true;