summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src/xgettext.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-09-10 16:52:09 +0900
committerDaiki Ueno <ueno@gnu.org>2015-09-10 16:53:11 +0900
commit7498236b9f7d9649733c3fc6eaf2aa0ebf4d3bf2 (patch)
tree1a96dbc59db080e7a5f37cef7dd5daca3778af48 /gettext-tools/src/xgettext.c
parent5f8c4728bad25939dc219d22f819a841433e0728 (diff)
downloadexternal_gettext-7498236b9f7d9649733c3fc6eaf2aa0ebf4d3bf2.zip
external_gettext-7498236b9f7d9649733c3fc6eaf2aa0ebf4d3bf2.tar.gz
external_gettext-7498236b9f7d9649733c3fc6eaf2aa0ebf4d3bf2.tar.bz2
Revert "xgettext: Allow multiple --copyright-holder"
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.
Diffstat (limited to 'gettext-tools/src/xgettext.c')
-rw-r--r--gettext-tools/src/xgettext.c70
1 files changed, 6 insertions, 64 deletions
diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c
index 2f34057..89d4d45 100644
--- a/gettext-tools/src/xgettext.c
+++ b/gettext-tools/src/xgettext.c
@@ -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;