From: Bruno Haible Date: Thu, 5 Jul 2001 12:24:02 +0000 (+0000) Subject: msgcomm must keep the header entry. X-Git-Tag: v0.11~625 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6cdbc5c68ac146936c2b5deb426543d08c6c9b;p=thirdparty%2Fgettext.git msgcomm must keep the header entry. --- diff --git a/src/ChangeLog b/src/ChangeLog index 827968961..154fbc0a0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-07-05 Bruno Haible + + * msgcomm.c (is_message_selected): Keep the header entry. + 2001-07-01 Bruno Haible * po-charset.h (po_lex_charset): New declaration. diff --git a/src/msgcomm.c b/src/msgcomm.c index b5b33edf1..7d223a8fa 100644 --- a/src/msgcomm.c +++ b/src/msgcomm.c @@ -459,8 +459,8 @@ static bool is_message_selected (mp) const message_ty *mp; { - /* FIXME: Add mp->msgid[0] == '\0' || ... here? */ - return (mp->used > more_than && mp->used < less_than); + return (mp->msgid[0] == '\0') /* keep the header entry, see msgcomm-17 test */ + || (mp->used > more_than && mp->used < less_than); } diff --git a/tests/ChangeLog b/tests/ChangeLog index 2b6512fa8..35716cbb1 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2001-07-05 Bruno Haible + + * msgcomm-22: New file, based on a report by Karl Eichwalder. + * Makefile.am (TESTS): Add msgcomm-22. + * msgcomm-12: Add the first header entry to the expected output. + * msgcomm-13: Likewise. + * msgcomm-14: Likewise. + 2001-06-23 Bruno Haible * msgcomm-18: New file, from Karl Eichwalder with modifications. diff --git a/tests/Makefile.am b/tests/Makefile.am index fce856dec..28ad2829a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,7 +24,7 @@ TESTS = gettext-1 gettext-2 \ msgcomm-1 msgcomm-2 msgcomm-3 msgcomm-4 msgcomm-5 msgcomm-6 msgcomm-7 \ msgcomm-8 msgcomm-9 msgcomm-10 msgcomm-11 msgcomm-12 msgcomm-13 \ msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 msgcomm-18 msgcomm-19 \ - msgcomm-20 msgcomm-21 \ + msgcomm-20 msgcomm-21 msgcomm-22 \ msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 \ msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \ msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 \ diff --git a/tests/msgcomm-12 b/tests/msgcomm-12 index cd5847529..7bf3ba319 100755 --- a/tests/msgcomm-12 +++ b/tests/msgcomm-12 @@ -73,6 +73,17 @@ ${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test12.out \ tmpfiles="$tmpfiles mcomm-test12.ok" cat << EOF > mcomm-test12.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + # unique msgid "2" msgstr "" diff --git a/tests/msgcomm-13 b/tests/msgcomm-13 index 7e5871611..40a9ed4f3 100755 --- a/tests/msgcomm-13 +++ b/tests/msgcomm-13 @@ -76,6 +76,17 @@ ${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test13.out \ tmpfiles="$tmpfiles mcomm-test13.ok" cat << EOF > mcomm-test13.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + # unique msgid "2" msgstr "" diff --git a/tests/msgcomm-14 b/tests/msgcomm-14 index 296876c7a..1e461312f 100755 --- a/tests/msgcomm-14 +++ b/tests/msgcomm-14 @@ -71,6 +71,16 @@ ${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test14.out \ tmpfiles="$tmpfiles mcomm-test14.ok" cat << EOF > mcomm-test14.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" EOF : ${DIFF=diff} diff --git a/tests/msgcomm-22 b/tests/msgcomm-22 new file mode 100755 index 000000000..f96dcc2c1 --- /dev/null +++ b/tests/msgcomm-22 @@ -0,0 +1,117 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# keep header file entry, otherwise the encoding is unknown + +tmpfiles="mcomm-test22.in1 mcomm-test22.in2" +cat < mcomm-test22.in1 +# German translations for GNU gettext package. +# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc. +# Karl Eichwalder , 2001. +# Ulrich Drepper , 1995-1997. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU gettext 0.10.36\n" +"POT-Creation-Date: 2001-05-23 23:03+0200\n" +"PO-Revision-Date: 2001-04-11 06:44+02:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/gettext.c:140 src/msgcmp.c:140 src/msgcomm.c:279 src/msgfmt.c:270 +#: src/msgmerge.c:255 src/msgunfmt.c:170 src/ngettext.c:120 src/xgettext.c:388 +#, c-format, no-wrap +msgid "" +"Copyright (C) %s Free Software Foundation, Inc.\n" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Copyright © %s Free Software Foundation, Inc.\n" +"Dies ist freie Software; in den Quellen befindet sich die Lizenzbedingung.\n" +"Es gibt KEINERLEI Garantie; nicht einmal für die TAUGLICHKEIT oder\n" +"die VERWENDBARKEIT ZU EINEN ANGEGEBENEN ZWECK.\n" +EOF + +cat < mcomm-test22.in2 +# German translations for GNU gettext package. +# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc. +# Karl Eichwalder , 2001. +# Ulrich Drepper , 1995-1997. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU gettext 0.10.36\n" +"POT-Creation-Date: 2001-05-23 23:03+0200\n" +"PO-Revision-Date: 2001-04-11 06:44+02:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/obstack.c:474 lib/xmalloc.c:86 src/po.c:308 src/po.c:381 src/po.c:389 +#: src/po.c:395 src/po.c:415 src/po.c:422 src/po.c:427 src/po.c:444 +msgid "memory exhausted" +msgstr "virtueller Speicher erschöpft" +EOF + +tmpfiles="$tmpfiles mcomm-test22.out" +rm -f mcomm-test22.out + +: ${MSGCOMM=msgcomm} + +${MSGCOMM} --less-than=2 -o mcomm-test22.out \ + mcomm-test22.in1 mcomm-test22.in2 + +tmpfiles="$tmpfiles mcomm-test22.ok" +cat << EOF > mcomm-test22.ok +# German translations for GNU gettext package. +# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc. +# Karl Eichwalder , 2001. +# Ulrich Drepper , 1995-1997. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU gettext 0.10.36\n" +"POT-Creation-Date: 2001-05-23 23:03+0200\n" +"PO-Revision-Date: 2001-04-11 06:44+02:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/gettext.c:140 src/msgcmp.c:140 src/msgcomm.c:279 src/msgfmt.c:270 +#: src/msgmerge.c:255 src/msgunfmt.c:170 src/ngettext.c:120 src/xgettext.c:388 +#, c-format, no-wrap +msgid "" +"Copyright (C) %s Free Software Foundation, Inc.\n" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Copyright © %s Free Software Foundation, Inc.\n" +"Dies ist freie Software; in den Quellen befindet sich die Lizenzbedingung.\n" +"Es gibt KEINERLEI Garantie; nicht einmal für die TAUGLICHKEIT oder\n" +"die VERWENDBARKEIT ZU EINEN ANGEGEBENEN ZWECK.\n" + +#: lib/obstack.c:474 lib/xmalloc.c:86 src/po.c:308 src/po.c:381 src/po.c:389 +#: src/po.c:395 src/po.c:415 src/po.c:422 src/po.c:427 src/po.c:444 +msgid "memory exhausted" +msgstr "virtueller Speicher erschöpft" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test22.ok mcomm-test22.out +result=$? + +rm -fr $tmpfiles + +exit $result