Daiki Ueno [Fri, 21 Aug 2015 05:43:30 +0000 (14:43 +0900)]
xgettext: Allow multiple --copyright-holder
Feature requested by Francesco Poli in:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682580>.
* xgettext.c (default_copyright_holder): New constant, renamed
from copyright_holder.
(copyright_holder): Define as a variable.
(main): Allow multiple --copyright-holder options.
(construct_header): Support multiple --copyright-holder options.
Daiki Ueno [Fri, 21 Aug 2015 01:22:01 +0000 (10:22 +0900)]
intl: Pacify compilation with pre-C99 compilers
* loadmsgcat.c (_nl_load_domain): Move the call to
__libc_lock_define_initialized_recursive to the end of local
variable declarations to avoid extra ';' being expanded to an
empty statement.
Reported by pan7 in:
<http://savannah.gnu.org/support/?108864>.
* gettext-tools/configure.ac (ARCHIVE_VERSION): New substituted
variable.
* gettext-tools/misc/gettextize.in (archive_version): New variable, set
to ARCHIVE_VERSION. Use it as the argument of AM_GNU_GETTEXT_VERSION.
* gettext-tools/tests/init-env.in (ARCHIVE_VERSION): New substituted
variable.
* gettext-tools/tests/autopoint-2: Use ARCHIVE_VERSION, instead of the
hard-coded version string.
* gettext-tools/tests/autopoint-3: Likewise.
Reported by Max Lin in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-07/msg00024.html>.
* gettextize.in: Replace AM_GNU_GETTEXT_VERSION invocation with
"$gettext_version" rather than "$version". This makes it easier
to maintain a minor release without being affected by the actual
version number generated by git-version-gen.
(gettext_version): New variable.
Compilation of the cldr-plurals tool was broken in the relocatable case
because of missing CPPFLAGS/LDFLAGS. Add the same flags used by other
tools to the makefile.
* gettext-tools/src/Makefile.am (cldr_plurals_CPPFLAGS)
(cldr_plurals_LDFLAGS): Adjust for --enable-relocatable
compilation.
Daiki Ueno [Mon, 29 Jun 2015 02:44:52 +0000 (11:44 +0900)]
msginit: Remove obsolete country codes
* gettext-tools/src/msginit.c (catalogname_for_locale): Remove sr_YU,
which were removed from ISO 3166-1:1997. Add comment saying that
pap_AN, which were removed from ISO 3166-1:2006, can be removed in the
future.
Reported by Jakub Wilk in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00057.html>.
Daiki Ueno [Thu, 25 Jun 2015 12:02:47 +0000 (21:02 +0900)]
xgettext: Fix the last change to literalstring
* gettext-tools/src/x-c.c (literalstring_parse): Bail out if C == NUL.
Also adjust the loop invariant in Unicode literal handling.
Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
Daiki Ueno [Thu, 25 Jun 2015 02:37:39 +0000 (11:37 +0900)]
xgettext: Make literal parser robust against NUL
* gettext-tools/src/x-c.c (literalstring_parse): Add more NUL checks.
Change the loop invariant so that C always points to the character
previously pointed by P.
Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
* gettext-tools/tests/xg-c-21.c (main): New file.
* gettext-tools/tests/xgettext-c-21 (result): New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
(EXTRA_DIST): Add xg-c-21.c.
Daiki Ueno [Wed, 24 Jun 2015 14:23:22 +0000 (23:23 +0900)]
xgettext: avoid out-of-bounds read in literals
* gettext-tools/src/x-c.c (literalstring_parse): Check if the next
character of a backslash is NUL. Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.
Daiki Ueno [Wed, 24 Jun 2015 03:04:25 +0000 (12:04 +0900)]
tests: Don't rely on echo -n
* gettext-tools/tests/msgfilter-8: Port the "echo -n" equivalent from gettext-2.
Reported by paul zimmermann in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00019.html>.
Daiki Ueno [Tue, 23 Jun 2015 09:04:35 +0000 (18:04 +0900)]
build: Fix build failure on Solaris
* gettext-tools/src/cldr-plurals.c: Include "basename.h".
(main): Place optind on the right hand side of the expression, to
work around build failure on Solaris.
Reported by Dagobert Michelsen in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00015.html>.
Daiki Ueno [Tue, 23 Jun 2015 04:03:09 +0000 (13:03 +0900)]
m4, help2man: Update from gnulib
* gettext-runtime/m4/codeset.m4: Update copyright year.
* gettext-runtime/m4/gettext.m4: Likewise.
* gettext-runtime/m4/iconv.m4: Likewise.
* gettext-runtime/m4/intl.m4: Likewise.
* gettext-runtime/m4/intldir.m4: Likewise.
* gettext-runtime/m4/intlmacosx.m4: Likewise.
* gettext-runtime/m4/lcmessage.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/po.m4: Likewise.
* gettext-runtime/m4/extern-inline.m4: Likewise. Port the following
change:
2015-04-29 Paul Eggert <eggert@cs.ucla.edu>
extern-inline: no need for workaround in GCC 5.1
* doc/extern-inline.texi (extern inline):
* m4/extern-inline.m4 (gl_EXTERN_INLINE):
GCC bugs 54113 and 63877 are fixed in GCC 5.1, so don't work
around these bugs in GCC 5.1 and later. Maybe in a decade or
two we can remove these workarounds.
* gettext-tools/man/help2man: Update copyright year.
Daiki Ueno [Tue, 23 Jun 2015 03:28:41 +0000 (12:28 +0900)]
intl: Update locale.alias
* locale.alias: Update from glibc:
2015-05-22 Paul Eggert <eggert@cs.ucla.edu>
Remove obsolete aliases that broke 'locale -a'
[BZ #18412]
* intl/locale.alias: Remove obsolete aliases "bokmål" and "français"
which caused 'locale -a' to output Latin-1 data in UTF-8 locales,
breaking some applications that use 'locale -a' output.
Change the encoding of this file from Latin-1 to ASCII to avoid
other potential problems with people grepping this file.
Daiki Ueno [Tue, 23 Jun 2015 01:16:25 +0000 (10:16 +0900)]
tests: Add test for msginit CLDR support
* gettext-tools/tests/msginit-4: New file.
* gettext-tools/tests/common/supplemental/plurals.xml: New data file.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
(EXTRA_DIST): Add new data file.
Daiki Ueno [Thu, 21 May 2015 04:03:50 +0000 (13:03 +0900)]
msginit: Guess plural rules from Unicode CLDR
* gettext-tools/src/Makefile.am (noinst_PROGRAMS): Add cldr-plurals.
(install-exec-local): Install cldr-plurals.
(BUILT_SOURCES): Add cldr-plural.c and cldr-plural.h.
(cldr_plural_SOURCES): New variable.
(cldr_plural_LDADD): New variable.
* gettext-tools/src/cldr-plural-exp.h: New file.
* gettext-tools/src/cldr-plural-exp.c: New file.
* gettext-tools/src/cldr-plural.y: New file.
* gettext-tools/src/cldr-plurals.c: New file.
* gettext-tools/src/msginit.c (plural_forms): Call cldr-plurals program
if the plural rule is not defined in the code.
* gettext-tools/doc/msginit.texi: More explanations about "meta
information".
* gettext-tools/doc/gettext.texi (Plural forms): Mention Unicode CLDR
support in msginit.
* gettext-tools/tests/cldr-plurals-1: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new tests.
* NEWS: Mention msginit change.
Daiki Ueno [Mon, 1 Jun 2015 03:12:28 +0000 (12:12 +0900)]
awk: Recognize .twjr file extension
* gettext-tools/src/x-awk.h (EXTENSIONS_AWK): Register file extensions
".gawk" and ".twjr". Suggested by Karl Berry in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-05/msg00032.html>.
* gettext-tools/doc/gettext.texi (gawk): Mention new file extensions
".gawk" and ".twjr".
Daiki Ueno [Mon, 1 Jun 2015 01:19:23 +0000 (10:19 +0900)]
doc: Update link to GNU hello
* gettext.texi (Adjusting Files): Update link to GNU hello
distribution. Suggested by Karl Berry in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-05/msg00031.html>.
* gettext-tools/src/x-c.c (init_flag_table_kde): New function.
(additional_keywords_kde): New variable.
(activate_additional_keywords_kde): New function.
(init_keywords): Optional addition of KDE-specific keywords.
* gettext-tools/src/x-c.h (init_flag_table_kde): New function declaration.
(activate_additional_keywords_kde): New function declaration.
* gettext-tools/src/xgettext.c (main): Invoke addition of KDE-specific
keywords when language is C++ with KDE.
Daiki Ueno [Wed, 11 Mar 2015 07:18:26 +0000 (16:18 +0900)]
msgunfmt: Check allocated size for static segment
Reported by Max Lin in:
http://lists.gnu.org/archive/html/bug-gettext/2015-03/msg00005.html
* read-mo.c (get_sysdep_string): Check if the embedded segment
size is valid, before adding it to the string length.
Daiki Ueno [Wed, 4 Mar 2015 06:29:53 +0000 (15:29 +0900)]
build: Update libtool files to 2.4.6
* m4/libtool.m4: Update from libtool-2.4.6, with modifications.
2008-04-06 Bruno Haible <bruno@clisp.org>
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}.
* m4/ltversion.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
Daiki Ueno [Thu, 29 Jan 2015 08:22:14 +0000 (17:22 +0900)]
xgettext: Support message syntax checks
With this change, xgettext could report common syntactic problems
in extracted strings. The current built-in checks are
ellipsis-unicode, space-ellipsis, and quote-unicode. Those checks
can be enabled with --check option of xgettext and disabled with
special "xgettext:" comment in source files.
Feature suggested by Philip Withnall in:
https://savannah.gnu.org/bugs/?44098
* gettext-tools/src/message.h (enum syntax_check_type): New enum.
(NSYNTAXCHECKS): New constant.
(enum is_syntax_check): New enum.
(struct message_ty): New field 'do_syntax_check'.
(syntax_check_name): New variable declaration.
* gettext-tools/src/message.c (syntax_check_name): New variable.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Propagate
mp->do_syntax_check.
* gettext-tools/src/msgmerge.c (message_merge): Propagate
ref->do_syntax_check.
* gettext-tools/src/msgl-check.h (syntax_check_message_list): New
declaration.
* gettext-tools/src/msgl-check.c (sentence_end): New function.
(syntax_check_ellipsis_unicode): New function.
(syntax_check_space_ellipsis): New function.
(syntax_check_quote_unicode): New function.
(syntax_check_message): New function.
(syntax_check_message_list): New function.
* gettext-tools/src/read-catalog-abstract.h (po_parse_comment_special):
Adjust function declaration.
* gettext-tools/src/read-catalog-abstract.c (po_parse_comment_special):
Add new argument SCP for syntax checking; all callers changed.
* gettext-tools/src/read-catalog.h (DEFAULT_CATALOG_READER_TY): New
field 'do_syntax_check'.
* gettext-tools/src/read-catalog.c (default_constructor): Initialize
this->do_syntax_check.
(default_copy_comment_state): Propagate this->do_syntax_check.
* gettext-tools/src/xgettext.c (long_options): Add --check option.
(main): Handle --check option.
(usage): Document --check option.
(remember_a_message): Propagate do_syntax_check value.
* gettext-tools/tests/xgettext-14: New file.
* gettext-tools/tests/sentence.c: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
(noinst_PROGRAMS): Add 'sentence'.
(sentence_SOURCES): New variable.
(sentence_CPPFLAGS): New variable.
(sentence_LDADD): New variable.
Daiki Ueno [Wed, 18 Feb 2015 02:17:38 +0000 (11:17 +0900)]
po: Clarify license notice
* gettext-runtime/po/Makefile.in.in: Replace our own wording of
licensing with GNU All-Permissive License. Reported by Riley Baird in:
<https://lists.debian.org/debian-legal/2015/01/msg00048.html>.
Daiki Ueno [Mon, 9 Feb 2015 03:17:22 +0000 (12:17 +0900)]
doc: Document plural forms for arb, tha, and ind
* gettext.texi (Plural forms): Add Arabic, Bahasa Indonesian, and
Thai.
Reported by Maryam Aly in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-02/msg00012.html>.
Alex Henrie [Thu, 5 Feb 2015 05:59:14 +0000 (22:59 -0700)]
xgettext: Wrap location comments to 79 characters
Previously, messages wre wrapped to 79 characters, but location
comments were wrapped to 78 characters.
* gettext-tools/src/write-po.c (message_print_comment_filepos): Fix
off-by-one in calculating line-wrapping width of location comment.
* gettext-tools/tests/xgettext-13: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
* gettext-tools/tests/mm-viet.out: Adjust to the recent line-wrapping
behavior change.
Daiki Ueno [Tue, 3 Feb 2015 08:09:23 +0000 (17:09 +0900)]
msgfilter: Factor out quoted string handling
For later use in xgettext, separate out the scanner part in
filter-quote.c into a separate file. See:
<https://savannah.gnu.org/bugs/?44098>.
* quote.h: New file split from filter-quote.c.
* filter-quote.c: Include "quote.h".
(convert_quote_callback): New function.
(convert_ascii_quote_to_unicode): Use scan_quoted from quote.h.
* Makefile.am (libgettextsrc_la_SOURCES): Add quote.h.
Daiki Ueno [Wed, 28 Jan 2015 07:50:20 +0000 (16:50 +0900)]
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.
* xgettext.c (remember_a_message): Building with gcc's
-fsanitize=undefined and running tests triggered:
xgettext.c:2425:17: runtime error: null pointer passed as argument \
2, which is declared to never be null
Adjust the argument of strncmp to never be null.
* msgmerge.c (message_merge): Likewise for memcpy.
Daiki Ueno [Fri, 23 Jan 2015 03:11:41 +0000 (12:11 +0900)]
build: Update libtool files to 2.4.5
* m4/libtool.m4: Update from libtool-2.4.5, with modifications.
2008-04-06 Bruno Haible <bruno@clisp.org>
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}.
* m4/ltoptions.m4: Likewise.
* m4/ltversion.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
Daiki Ueno [Fri, 23 Jan 2015 02:22:47 +0000 (11:22 +0900)]
build: Fix parallel build from git checkout
Since po-gram-gen2.h depends on po-gram-gen.h, an explicit
dependency on the YACC rule is needed for parallel compilation.
* Makefile.am (po-gram-gen.h): Depend on po-gram-gen.c.
Will Newton [Wed, 21 Jan 2015 02:55:02 +0000 (11:55 +0900)]
intl: Merge from glibc
* bindtextdom.c: Update copyright to use year ranges.
* dcgettext.c: Update copyright to use year ranges.
[_LIBC]: Use libc_hidden_def instead of INTDEF.
* dcigettext.c: Update copyright to use year ranges.
Test HAVE_TSEARCH with #ifdef rather than #if.
(DCIGETTEXT) [_LIBC]: Use __current_locale_name instead of
_current_locale_name.
* dcngettext.c: Update copyright to use year ranges.
* dgettext.c: Update copyright to use year ranges.
[_LIBC]: Remove use of INTUSE macro.
* dngettext.c: Update copyright to use year ranges.
* explodename.c: Likewise.
* finddomain.c: Update copyright to use year ranges.
(_nl_finddomain_subfreeres): Use void in no-arguments function
definition.
* gettext.c: Update copyright to use year ranges.
[_LIBC]: Remove use of INTUSE macro.
* gettextP.h: Update copyright to use year ranges.
[_LIBC]: Forward declaration of struct loaded_domain.
* gmo.h: Update copyright to use year ranges.
* hash-string.c: Likewise.
* hash-string.h: Likewise.
* l10nflist.c: Update copyright to use year ranges.
[_LIBC]: Remove use of INTUSE macro.
Wrap pop function in [!ARCH_POP].
* loadinfo.h: Update copyright to use year ranges.
* loadmsgcat.c: Likewise.
* localealias.c: Update copyright to use year ranges.
Test ENABLE_RELOCATABLE with #ifdef rather than #if.
[_LIBC]: Use __strcasecmp_l for strcasecmp.
[_LIBC]: Use __fgets_unlocked for FGETS.
Test HAVE_DECL_FGETS_UNLOCKED with #ifdef rather than #if.
Test HAVE_DECL_FEOF_UNLOCKED with #ifdef rather than #if.
(read_alias_file) [_LIBC]: Open file with O_CLOEXEC.
(extend_alias_table): Use void in no-arguments function
definition.
* ngettext.c: Update copyright to use year ranges.
* plural-exp.c: Update copyright to use year ranges.
Test __APPLE_CC__ with #ifdef rather than #if.
(GERMANIC_PLURAL): Make const.
(init_germanic_plural): Use void in no-arguments function
definition.
* plural-exp.h: Update copyright to use year ranges.
(GERMANIC_PLURAL): Make const.
* plural.y: Update copyright to use year ranges.
* textdomain.c: Likewise.