diff options
author | Bruno Haible <bruno@clisp.org> | 2001-12-10 12:54:56 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-21 23:36:37 +0200 |
commit | 2a500dbb7cb740301b109534b219c9692fd9add3 (patch) | |
tree | 44dba16550059a586ee268938766c57e8db0e934 /src/msgexec.c | |
parent | ac6e10bb4c917df3ea0cbcb55b0ebc7bf96aa62e (diff) | |
download | external_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.zip external_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.tar.gz external_gettext-2a500dbb7cb740301b109534b219c9692fd9add3.tar.bz2 |
New msgexec option --keep-header.
Diffstat (limited to 'src/msgexec.c')
-rw-r--r-- | src/msgexec.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; |