@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.
+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
/* 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;
{ "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' },
-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\
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;