diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/msgexec.c | 9 |
2 files changed, 16 insertions, 0 deletions
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; |