]> git.ipfire.org Git - thirdparty/gettext.git/commit
When reading PO files, treat CRLF line terminators like LF.
authorBruno Haible <bruno@clisp.org>
Tue, 31 Dec 2024 01:43:41 +0000 (02:43 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 31 Dec 2024 01:43:41 +0000 (02:43 +0100)
commit2f8309bf23eb35a51754e32acb7c52fc56885b57
tree44c9fc8a2f5b1b7cb4ce15fa2d9bbb025e6b8afe
parentd2fbe62c40512deffeb04365a3e043aa8b21b796
When reading PO files, treat CRLF line terminators like LF.

Reported by Hendy Irawan <hendy@hendyirawan.com> at
<https://savannah.gnu.org/bugs/?52395>.

* gettext-tools/src/read-po-internal.h (MBFILE_MAX_PUSHBACK): Renamed from
NPUSHBACK. Increase by 1.
(struct mbfile): Rename field 'have_pushback' to 'pushback_count'.
* gettext-tools/src/read-po-lex.c (mbfile_init): Update.
(mbfile_getc): Read pushed-back character before testing for sticky EOF.
(mbfile_ungetc): Update.
(mbfile_getc_normalized): New function.
(lex_getc): Invoke mbfile_getc_normalized instead of mbfile_getc.
* gettext-tools/tests/testdata/crlf.pot: New file.
* gettext-tools/tests/msgcat-23: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
gettext-tools/src/read-po-internal.h
gettext-tools/src/read-po-lex.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/msgcat-23 [new file with mode: 0755]
gettext-tools/tests/testdata/crlf.pot [new file with mode: 0644]