summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-12-10 12:54:56 +0000
committerBruno Haible <bruno@clisp.org>2009-06-21 23:36:37 +0200
commit2a500dbb7cb740301b109534b219c9692fd9add3 (patch)
tree44dba16550059a586ee268938766c57e8db0e934
parentac6e10bb4c917df3ea0cbcb55b0ebc7bf96aa62e (diff)
downloadexternal_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.zip
external_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.tar.gz
external_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.tar.bz2
New msgexec option --keep-header.
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/msgexec.texi5
-rw-r--r--src/ChangeLog7
-rw-r--r--src/msgexec.c9
4 files changed, 25 insertions, 0 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index a3071cd..50a22b6 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2001-12-07 Bruno Haible <bruno@clisp.org>
+
+ * msgexec.texi: Document option --keep-header.
+
2001-12-05 Bruno Haible <haible@clisp.cons.org>
* matrix.texi: Update.
diff --git a/doc/msgexec.texi b/doc/msgexec.texi
index c718e41..2ced8d5 100644
--- a/doc/msgexec.texi
+++ b/doc/msgexec.texi
@@ -69,6 +69,11 @@ Always write an output file even if it contains no message.
@item --indent
Write the .po file using indented style.
+@item --keep-header
+Keep the header entry, i.e. the message with @samp{msgid ""}, unmodified,
+instead of filtering it. By default, the header entry is subject to
+filtering like any other message.
+
@item --no-location
Do not write @samp{#: @var{filename}:@var{line}} lines.
diff --git a/src/ChangeLog b/src/ChangeLog
index 3678339..db7bdea 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-07 Bruno Haible <bruno@clisp.org>
+
+ * msgexec.c (keep_header): New variable.
+ (long_options): New option --keep-header.
+ (usage): Document option --keep-header.
+ (process_message): Implement --keep-header.
+
2001-12-06 Bruno Haible <bruno@clisp.org>
* format.h (struct formatstring_parser): Add 'noisy' argument to
diff --git a/src/msgexec.c b/src/msgexec.c
index b73c1ef..4fca57d 100644
--- a/src/msgexec.c
+++ b/src/msgexec.c
@@ -71,6 +71,9 @@
/* Force output of PO file even if empty. */
static int force_po;
+/* Keep the header entry unmodified. */
+static int keep_header;
+
/* Name of the subprogram. */
static const char *sub_name;
@@ -91,6 +94,7 @@ static const struct option long_options[] =
{ "help", no_argument, NULL, 'h' },
{ "indent", no_argument, NULL, CHAR_MAX + 1 },
{ "input", required_argument, NULL, 'i' },
+ { "keep-header", no_argument, &keep_header, 1 },
{ "no-escape", no_argument, NULL, CHAR_MAX + 2 },
{ "no-location", no_argument, &line_comment, 0 },
{ "output-file", required_argument, NULL, 'o' },
@@ -392,6 +396,7 @@ Output details:\n\
-E, --escape use C escapes in output, no extended chars\n\
--force-po write PO file even if empty\n\
--indent indented output style\n\
+ --keep-header keep header entry unmodified, don't filter it\n\
--no-location suppress '#: filename:line' lines\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
@@ -679,6 +684,10 @@ process_message (mp)
char *q;
size_t k;
+ /* Keep the header entry unmodified, if --keep-header was given. */
+ if (mp->msgid[0] == '\0' && keep_header)
+ return;
+
/* Count NUL delimited substrings. */
for (p = msgstr, nsubstrings = 0;
p < msgstr + msgstr_len;