]> git.ipfire.org Git - thirdparty/gettext.git/commit
msgfilter: Add --newline option
authorDaiki Ueno <ueno@gnu.org>
Wed, 28 Jan 2015 07:50:20 +0000 (16:50 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 29 Jan 2015 03:31:50 +0000 (12:31 +0900)
commit96dde0b8bdf6e4930f22556412d1680721929cd1
treebcb636a22b8c7080a7945d9f649f75f4ff274689
parent2d36f1e1de7521090272b88f161711f95228c19d
msgfilter: Add --newline option

The filter program was supposed to handle translation without a
newline character at the end of line.  This was causing
portability problems with standard text processing programs on
some platforms (BSD sed, for instance) and not friendly towards
POSIX, where a "text file" is required to have an ending newline.
The new --newline option controls the behavior.  If it is given,
both filter input and output are assumed to end with a newline
character.
* gettext-tools/src/msgfilter.c (newline): New variable.
(long_options): Add --newline option.
(main): Handle --newline option.
(usage): Document --newline option.
(process_string_with_newline): New function which wraps
process_string.
(process_message): Use process_string_with_newline instead of
process_string if --newline is specified.

* gettext-tools/tests/msgfilter-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.

* gettext-tools/doc/msgfilter.texi: Document --newline option.
gettext-tools/doc/ChangeLog
gettext-tools/doc/msgfilter.texi
gettext-tools/src/ChangeLog
gettext-tools/src/msgfilter.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/Makefile.am
gettext-tools/tests/msgfilter-8 [new file with mode: 0755]