]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
2 years agoSilence a gcc warning "array subscript ... is partly outside array bounds".
Bruno Haible [Fri, 26 May 2023 22:25:12 +0000 (00:25 +0200)] 
Silence a gcc warning "array subscript ... is partly outside array bounds".

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add flexmember.
* gettext-tools/src/xg-arglist-parser.h (struct arglist_parser): Use
FLEXIBLE_ARRAY_MEMBER.
* gettext-tools/src/xg-arglist-parser.c: Include flexmember.h.
(arglist_parser_alloc, arglist_parser_clone): Use FLEXNSIZEOF instead of
hand-made size computations.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 9 Apr 2023 09:52:18 +0000 (11:52 +0200)] 
Update to the newest gnulib.

2 years agolibgrep: Optimize and silence gcc warning.
Bruno Haible [Fri, 26 May 2023 21:02:24 +0000 (23:02 +0200)] 
libgrep: Optimize and silence gcc warning.

* gettext-tools/libgrep/m-fgrep.c (Fexecute): Set mb_properties to NULL in a
unibyte locale.

2 years agolibgrep: Modernize.
Bruno Haible [Fri, 26 May 2023 20:59:26 +0000 (22:59 +0200)] 
libgrep: Modernize.

* gettext-tools/libgrep/m-fgrep.c: Include <wchar.h> unconditionally. Assume
mbrlen function, by virtue of the gnulib module 'mbrlen'. Don't include
<wctype.h>. Assume ANSI C.

2 years agoSilence a gcc warning.
Bruno Haible [Fri, 26 May 2023 16:59:49 +0000 (18:59 +0200)] 
Silence a gcc warning.

* gettext-tools/src/write-po.c (memset_small): Use
'#pragma GCC diagnostic ignored' to silence a bogus gcc warning.

2 years agoSilence a gcc warning.
Bruno Haible [Fri, 26 May 2023 15:21:25 +0000 (17:21 +0200)] 
Silence a gcc warning.

* gettext-tools/src/format-scheme.c (II): Mark as possibly unused.

2 years agolibxml: Silence several gcc warnings.
Bruno Haible [Fri, 26 May 2023 15:07:04 +0000 (17:07 +0200)] 
libxml: Silence several gcc warnings.

* gnulib-local/lib/libxml/SAX2.c (xmlNsErrMsg): Mark as possibly unused.
(xmlSAX2AttributeDecl, xmlSAX2ElementDecl, xmlSAX2NotationDecl): Mark a local
variable as possibly unused.
* gnulib-local/lib/libxml/encoding.c (xmlCharEncCloseFunc): Likewise.
* gnulib-local/lib/libxml/trionan.c (compute_minus_zerod, minus_zerod): Mark as
possibly unused.
* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Use a differently typed
variable cloneAttr.

2 years agointl: Silence a gcc warning.
Bruno Haible [Fri, 26 May 2023 14:11:55 +0000 (16:11 +0200)] 
intl: Silence a gcc warning.

* gettext-runtime/intl/localealias.c (read_alias_file): Silence a bogus
-Wuse-after-free warning.

2 years agobuild: Improve autoconf quoting.
Bruno Haible [Fri, 26 May 2023 14:03:57 +0000 (16:03 +0200)] 
build: Improve autoconf quoting.

* gettext-runtime/intl/configure.ac: Fix quoting of AS_HELP_STRING argument.
* gettext-tools/configure.ac: Likewise.

2 years agoSupport creating shared libraries on Hurd/x86_64.
Bruno Haible [Sun, 21 May 2023 20:22:38 +0000 (22:22 +0200)] 
Support creating shared libraries on Hurd/x86_64.

Patch from
<https://lists.gnu.org/archive/html/bug-hurd/2023-05/msg00086.html>.

* m4/libtool.m4 (_LT_ENABLE_LOCK): Treat Hurd/x86_64 like
Linux/x86_64.

2 years agodoc: Clarify when extracted comments get extracted.
Bruno Haible [Wed, 3 May 2023 16:32:57 +0000 (18:32 +0200)] 
doc: Clarify when extracted comments get extracted.

Fixes the fix from <https://savannah.gnu.org/bugs/index.php?42376>.
Prompted by <https://savannah.gnu.org/bugs/index.php?64136>.

* gettext-tools/doc/xgettext.texi: Clarify that it's not blank lines, but lines
with tokens, that prevent the extraction of a preceding comment block.

2 years agohostname: Use more modern network APIs.
Bruno Haible [Sat, 1 Apr 2023 15:14:43 +0000 (17:14 +0200)] 
hostname: Use more modern network APIs.

Reported by Jens Petersen <petersen@redhat.com>
at <https://savannah.gnu.org/bugs/?63983>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add getaddrinfo.
* gettext-tools/src/hostname.c (HAVE_GETADDRINFO): Define to 1.
Do the #includes for gethostname() after those for getaddrinfo().
(ipv4_is_linklocal, ipv6_is_linklocal): New functions.
(print_hostname): For long_format and ip_format, prefer getaddrinfo over
gethostbyname.
* gettext-tools/src/Makefile.am (hostname_LDADD): New variable.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sat, 1 Apr 2023 15:05:27 +0000 (17:05 +0200)] 
Update to the newest gnulib.

2 years agoxgettext: In language Tcl, fix the \u, \U handling.
Bruno Haible [Sat, 1 Apr 2023 13:36:04 +0000 (15:36 +0200)] 
xgettext: In language Tcl, fix the \u, \U handling.

* gettext-tools/src/x-tcl.c (do_getc_escaped_low_surrogate): Actually store the
read characters in buf.

2 years agoUse string-desc module from gnulib.
Bruno Haible [Thu, 30 Mar 2023 13:18:27 +0000 (15:18 +0200)] 
Use string-desc module from gnulib.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add string-desc. Remove memmem,
memrchr.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/src/str-desc.h: Remove file.
* gettext-tools/src/str-desc.c: Remove file.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/msgl-ascii.h: Include string-desc.h instead of str-desc.h.
Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/msgl-ascii.c: Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/msgl-iconv.h: Include string-desc.h instead of str-desc.h.
Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/msgl-iconv.c: Include string-desc.h instead of str-desc.h.
Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/xg-encoding.h: Include string-desc.h instead of str-desc.h.
Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/xg-encoding.c (string_desc_from_current_source_encoding):
Use string_desc_t instead of string_desc_ty.
* gettext-tools/src/x-perl.c: Include string-desc.h instead of str-desc.h.
(extract_quotelike_pass1, extract_quotelike_pass1_utf8, extract_quotelike,
extract_triple_quotelike, interpolate_keywords): Use string_desc_t instead of
string_desc_ty.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Remove str-desc.h.
(libgettextsrc_la_SOURCES): Remove str-desc.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Remove
str-desc.c.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Thu, 30 Mar 2023 10:26:00 +0000 (12:26 +0200)] 
Update to the newest gnulib.

2 years agointl: Simplify use of vasnprintf from Gnulib.
Bruno Haible [Fri, 17 Mar 2023 16:14:27 +0000 (17:14 +0100)] 
intl: Simplify use of vasnprintf from Gnulib.

* autogen.sh (GNULIB_MODULES_LIBINTL): Use vasnprintf-posix instead of vasnprintf.
* gettext-runtime/intl/vasnprintf.h: Remove file, moved to gnulib.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Remove vasnprintf.h.
(printf.lo): Simplify dependencies accordingly.

2 years agointl: Fix bug in the exported *wprintf functions.
Bruno Haible [Fri, 17 Mar 2023 16:08:12 +0000 (17:08 +0100)] 
intl: Fix bug in the exported *wprintf functions.

* autogen.sh (GNULIB_MODULES_LIBINTL): Add vasnwprintf-posix.
* gettext-runtime/intl/configure.ac: Hide the symbols from the gnulib modules
isnand-nolibm, isnanl-nolibm, printf-frexp, printf-frexpl, signbit, vasnwprintf,
frexp-nolibm, frexpl-nolibm.
* gettext-runtime/intl/printf.c: Don't instantiate the vasnwprintf code here.
* gettext-runtime/intl/wprintf-parse.h: Remove file, moved to gnulib.
* gettext-runtime/intl/vasnwprintf.h: Remove file, moved to gnulib.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Remove wprintf-parse.h,
vasnwprintf.h.
(printf.lo): Simplify dependencies accordingly.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Fri, 17 Mar 2023 12:20:28 +0000 (13:20 +0100)] 
Update to the newest gnulib.

2 years agobuild: Fix link error on native Windows (regression 2023-03-15).
Bruno Haible [Fri, 17 Mar 2023 01:44:56 +0000 (02:44 +0100)] 
build: Fix link error on native Windows (regression 2023-03-15).

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Add
memmem and memrchr, needed by str-desc.c.

2 years agodoc: Add a clarification.
Bruno Haible [Wed, 15 Mar 2023 23:11:20 +0000 (00:11 +0100)] 
doc: Add a clarification.

Reported by Christian Ohm <chr.ohm@gmx.net>
in <https://savannah.gnu.org/bugs/?36084>.

* gettext-tools/doc/gettext.texi (c-format Flag): Clarify that an xgettext:...
comment applies only to the next string.

2 years agoxgettext: In language Perl, avoid a crash.
Bruno Haible [Wed, 15 Mar 2023 21:47:47 +0000 (22:47 +0100)] 
xgettext: In language Perl, avoid a crash.

* gettext-tools/src/xg-arglist-parser.c (arglist_parser_clone): Clone the
msgid_pos correctly.
* gettext-tools/tests/xgettext-perl-10: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language Perl, avoid a crash when NUL is used as delimiter.
Bruno Haible [Wed, 15 Mar 2023 20:57:56 +0000 (21:57 +0100)] 
xgettext: In language Perl, avoid a crash when NUL is used as delimiter.

* gettext-tools/src/str-desc.h: New file.
* gettext-tools/src/str-desc.c: New file.
* gettext-tools/src/FILES: Describe them.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add str-desc.h.
(libgettextsrc_la_SOURCES): Add str-desc.c.
* gettext-tools/src/msgl-ascii.h: Include str-desc.h.
(is_ascii_string_desc): New declaration.
* gettext-tools/src/msgl-ascii.c (is_ascii_string_desc): New function.
* gettext-tools/src/msgl-iconv.h: Include str-desc.h.
(convert_string_desc_directly): New declaration.
* gettext-tools/src/msgl-iconv.c: Include str-desc.h.
(convert_string_desc_directly): New function.
* gettext-tools/src/xg-encoding.h: Include str-desc.h.
(string_desc_from_current_source_encoding): New declaration.
* gettext-tools/src/xg-encoding.c (string_desc_from_current_source_encoding):
New function.
* gettext-tools/src/x-perl.c: Include str-desc.h, c-ctype.h.
(extract_quotelike_pass1): Return a string_desc_ty instead of a 'char *'.
(extract_quotelike_pass1_utf8): Likewise.
(extract_quotelike, extract_triple_quotelike): Update.
(interpolate_keywords): Take a string_desc_ty instead of a 'const char *' as
argument.
(x_perl_prelex): Update.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
str-desc.c.
* gettext-tools/tests/xgettext-perl-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agopo: In the Makefiles, enable --quiet by default when possible.
Bruno Haible [Tue, 14 Mar 2023 21:14:17 +0000 (22:14 +0100)] 
po: In the Makefiles, enable --quiet by default when possible.

This is possible because msgmerge became faster
- through an index-based fuzzy search (msgl-fsearch.c) in 2006,
- through OpenMP parallelization in 2006,
- through processor speedups over the years.
The only case where msgmerge is still slow is when a compendium is in use.

Suggested by Marcus Müller <marcus_savannah@hostalia.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00034.html>.

* gettext-runtime/po/Makefile.in.in ($(POFILES), update-po): If msgmerge has
version ≥ 0.11, pass option --quiet.
* gettext-runtime/po/Makevars (MSGMERGE_OPTIONS): Don't suggest --quiet any
more.
* gettext-tools/po/Makevars (MSGMERGE_OPTIONS): Likewise.
* gettext-tools/examples/hello-*/po/Makevars (MSGMERGE_OPTIONS): Likewise.
* gettext-tools/examples/hello-*/po/Makefile.am ($(POFILES), update-po): If
msgmerge has version ≥ 0.11, pass option --quiet.
(MSGMERGE_OPTIONS): Don't suggest --quiet any more.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.
* gettext-tools/examples/po/Makefile.am ($(POFILES), update-po): Pass option
--quiet to msgmerge.
(MSGMERGE_OPTIONS): Don't suggest --quiet any more.

2 years agoxgettext: In language Tcl, support \x, \u, \U escapes as specified in Tcl 8.6.
Bruno Haible [Tue, 14 Mar 2023 11:59:22 +0000 (12:59 +0100)] 
xgettext: In language Tcl, support \x, \u, \U escapes as specified in Tcl 8.6.

* gettext-tools/src/x-tcl.c: Update comments.
(phase1_pushback): Increase size to 5.
(do_getc_escaped): For \x, parse only up to 2 hexadecimal characters.
Handle '\U'.
(do_getc_escaped_low_surrogate): New function.
(accumulate_word): After reading a high surrogate, see if it is followed by a
low surrogate.
* gettext-tools/tests/xgettext-tcl-4: Change expected outcome for \x. Add test
cases for \u with surrogates and for \U.
* gettext-tools/tests/xgettext-tcl-5: Add more test cases.
* NEWS: Mention the change.

2 years agoxgettext: In language Tcl, avoid a crash at surrogate character escapes.
Bruno Haible [Tue, 14 Mar 2023 08:37:51 +0000 (09:37 +0100)] 
xgettext: In language Tcl, avoid a crash at surrogate character escapes.

* gettext-tools/src/x-tcl.c (accumulate_word): Warn when seeing a surrogate
character, instead of aborting.
* gettext-tools/tests/xgettext-tcl-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language Shell, avoid a crash.
Bruno Haible [Tue, 14 Mar 2023 02:19:59 +0000 (03:19 +0100)] 
xgettext: In language Shell, avoid a crash.

* gettext-tools/src/x-sh.c (phase1_pushback): Increase size by 1.
* gettext-tools/tests/xgettext-sh-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agolisp-format, scheme-format: Fix a loop transformation.
Bruno Haible [Tue, 14 Mar 2023 01:41:27 +0000 (02:41 +0100)] 
lisp-format, scheme-format: Fix a loop transformation.

* gettext-tools/src/format-lisp.c (rotate_loop): Assign the new
list->repeated.count.
* gettext-tools/src/format-scheme.c (rotate_loop): Likewise.
* gettext-tools/tests/xgettext-lisp-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agolisp-format: Fix a crash in format string that contains "~@?" before "~V".
Bruno Haible [Tue, 14 Mar 2023 00:38:13 +0000 (01:38 +0100)] 
lisp-format: Fix a crash in format string that contains "~@?" before "~V".

* gettext-tools/src/format-lisp.c (nocheck_params): Don't call
add_req_type_constraint if position < 0.
* gettext-tools/tests/xgettext-lisp-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agolisp-format, scheme-format: Fix a memory overrun.
Bruno Haible [Tue, 14 Mar 2023 00:04:45 +0000 (01:04 +0100)] 
lisp-format, scheme-format: Fix a memory overrun.

* gettext-tools/src/format-lisp.c (make_repeated_list): Fix upper bound of a
loop.
* gettext-tools/src/format-scheme.c (make_repeated_list): Likewise.
* gettext-tools/tests/xgettext-lisp-4: New file.
* gettext-tools/tests/xgettext-scheme-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agolisp-format, scheme-format: Improve run-time checks.
Bruno Haible [Mon, 13 Mar 2023 22:11:46 +0000 (23:11 +0100)] 
lisp-format, scheme-format: Improve run-time checks.

* gettext-tools/src/format-lisp.c (add_type_constraint,
add_listtype_constraint): Always check the result.
* gettext-tools/src/format-scheme.c (add_type_constraint,
add_listtype_constraint): Likewise.

2 years agoFix lisp-format, scheme-format: Add a loop normalization.
Bruno Haible [Mon, 13 Mar 2023 19:52:33 +0000 (20:52 +0100)] 
Fix lisp-format, scheme-format: Add a loop normalization.

* gettext-tools/src/format-lisp.c (normalize_outmost_list): Algorithmic fixes.
* gettext-tools/src/format-scheme.c (normalize_outmost_list): Likewise.
* gettext-tools/tests/format-lisp-2: Add another test.
* gettext-tools/tests/format-scheme-2: Likewise.

2 years agoFix lisp-format, scheme-format: Fix a memory corruption bug.
Bruno Haible [Sun, 12 Mar 2023 23:51:07 +0000 (00:51 +0100)] 
Fix lisp-format, scheme-format: Fix a memory corruption bug.

* gettext-tools/src/format-lisp.c (make_repeated_list): Access the correct
array.
* gettext-tools/src/format-scheme.c (make_repeated_list): Likewise.
* gettext-tools/tests/xgettext-lisp-3: New file.
* gettext-tools/tests/xgettext-scheme-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language JavaScript, avoid a crash.
Bruno Haible [Sun, 12 Mar 2023 23:21:50 +0000 (00:21 +0100)] 
xgettext: In language JavaScript, avoid a crash.

This avoids a crash
"Assertion `phase2_pushback_length + j < SIZEOF (phase2_pushback)' failed.".

* gettext-tools/src/x-javascript.c (phase2_pushback): Increase size by 1.
* gettext-tools/tests/xgettext-javascript-12: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language JavaScript, avoid a crash at an XML comment, CDATA, or PI.
Bruno Haible [Sun, 12 Mar 2023 23:10:47 +0000 (00:10 +0100)] 
xgettext: In language JavaScript, avoid a crash at an XML comment, CDATA, or PI.

* gettext-tools/src/x-javascript.c (phase5_scan_xml_markup): Return int instead
of bool.
(phase5_get): Ignore XML markup parsed by phase5_scan_xml_markup.
* gettext-tools/tests/xgettext-javascript-9: New file.
* gettext-tools/tests/xgettext-javascript-10: New file.
* gettext-tools/tests/xgettext-javascript-11: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language JavaScript, avoid a crash for some non-ASCII input.
Bruno Haible [Sun, 12 Mar 2023 14:25:33 +0000 (15:25 +0100)] 
xgettext: In language JavaScript, avoid a crash for some non-ASCII input.

* gettext-tools/src/xg-encoding.c (non_ascii_error_message,
non_utf8_error_message): Handle all possible lexical_context_ty values.
* gettext-tools/tests/xgettext-javascript-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language C#, avoid a crash due to a too small buffer.
Bruno Haible [Sun, 12 Mar 2023 12:33:30 +0000 (13:33 +0100)] 
xgettext: In language C#, avoid a crash due to a too small buffer.

* gettext-tools/src/x-csharp.c (phase3_pushback): Increase size to 10.
* gettext-tools/tests/xgettext-csharp-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoFix python-brace-format: Fix placement of FMTDIR_ERROR marker.
Bruno Haible [Sun, 12 Mar 2023 12:11:58 +0000 (13:11 +0100)] 
Fix python-brace-format: Fix placement of FMTDIR_ERROR marker.

* gettext-tools/src/format-python-brace.c (parse_directive): Simplify. Fix
placement of FMTDIR_ERROR marker and improve error message in one case.
* gettext-tools/tests/format-python-brace-1: Add more test cases.

2 years agoFix python-brace-format: Disallow empty precision.
Bruno Haible [Sun, 12 Mar 2023 11:28:00 +0000 (12:28 +0100)] 
Fix python-brace-format: Disallow empty precision.

* gettext-tools/src/format-python-brace.c (parse_directive): After '.', expect
at least one digit.
* gettext-tools/tests/format-python-brace-1: Add a test case.

2 years agoxgettext: Avoid a crash due to a python-brace-format string with a NUL byte.
Bruno Haible [Sun, 12 Mar 2023 10:45:11 +0000 (11:45 +0100)] 
xgettext: Avoid a crash due to a python-brace-format string with a NUL byte.

* gettext-tools/src/format-python-brace.c: Improve comments.
(parse_directive): Don't read past the string end if c1 is NUL.
* gettext-tools/tests/xgettext-python-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: Fix abort when outputting a msgid that has an invalid UTF-8 character.
Bruno Haible [Sun, 12 Mar 2023 00:39:57 +0000 (01:39 +0100)] 
xgettext: Fix abort when outputting a msgid that has an invalid UTF-8 character.

* gettext-tools/src/xg-encoding.c: Include unistr.h.
(non_utf8_error_message): New function.
(from_current_source_encoding): When xgettext_current_source_encoding is
"UTF-8", check that the string is well-formed UTF-8.
* gettext-tools/tests/xgettext-c-8: New file.
* gettext-tools/tests/xgettext-python-5: New file.
* gettext-tools/tests/xgettext-elisp-3: New file.
* gettext-tools/tests/xgettext-librep-3: New file.
* gettext-tools/tests/xgettext-awk-3: New file.
* gettext-tools/tests/xgettext-lua-3: New file.
* gettext-tools/tests/xgettext-vala-4: New file.
* gettext-tools/tests/xgettext-php-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoSimplify code.
Bruno Haible [Sat, 11 Mar 2023 02:31:25 +0000 (03:31 +0100)] 
Simplify code.

* gettext-tools/src/format-python-brace.c (parse_upto): Remove redundant
declaration.

2 years agoxgettext: In language Vala, report out-of-range hexadecimal escapes.
Bruno Haible [Sat, 11 Mar 2023 00:21:40 +0000 (01:21 +0100)] 
xgettext: In language Vala, report out-of-range hexadecimal escapes.

This avoids a later crash
"Assertion `UNICODE_VALUE (c) >= 0 && UNICODE_VALUE (c) < 0x110000' failed."

* gettext-tools/src/x-vala.c (phase7_getc): When the value of a hexadecimal
escape sequence overflows, warn and use the last value before it overflowed.
* gettext-tools/tests/xgettext-vala-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language C, report out-of-range hexadecimal escapes.
Bruno Haible [Sat, 11 Mar 2023 00:02:47 +0000 (01:02 +0100)] 
xgettext: In language C, report out-of-range hexadecimal escapes.

This avoids a later crash
"Assertion `UNICODE_VALUE (c) >= 0 && UNICODE_VALUE (c) < 0x110000' failed."

* gettext-tools/src/x-c.c (phase7_getc): When the value of a hexadecimal escape
sequence overflows, warn and use the last value before it overflowed.
* gettext-tools/tests/xgettext-c-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language PO, handle non-ASCII non-UTF-8 input files correctly.
Bruno Haible [Fri, 10 Mar 2023 22:32:24 +0000 (23:32 +0100)] 
xgettext: In language PO, handle non-ASCII non-UTF-8 input files correctly.

* gettext-tools/src/x-po.c: Include msgl-iconv.h, msgl-ascii.h, po-charset.h.
(extract): If a header charset is present, convert the messages to UTF-8;
otherwise verify that they are all ASCII.
* gettext-tools/tests/xgettext-po-3: New file.
* gettext-tools/tests/xgettext-po-4: New file.
* gettext-tools/tests/testdata/xg-po-3.po: New file.
* gettext-tools/tests/testdata/xg-po-4.po: New file.
* gettext-tools/tests/Makefile.am (TESTS, EXTRA_DIST): Add them.
* NEWS: Mention the change.

2 years agopo-mode: Fix incompatibility with the forthcoming Emacs 29.
Bruno Haible [Thu, 9 Mar 2023 23:07:52 +0000 (00:07 +0100)] 
po-mode: Fix incompatibility with the forthcoming Emacs 29.

Patch by Takesi Ayanokoji <ayanokoji.takesi@gmail.com>.

* gettext-tools/emacs/po-mode.el (po-font-lock-keywords): Use
font-lock-constant-face, introduced in Emacs 20.3, instead of the
long-deprecated font-lock-reference-face.
* NEWS: Mention it.

2 years agoxgettext: In language YCP, avoid stack overflow.
Bruno Haible [Thu, 9 Mar 2023 21:30:17 +0000 (22:30 +0100)] 
xgettext: In language YCP, avoid stack overflow.

* gettext-tools/src/x-ycp.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(extract_parenthesized): Increase and check nesting_depth before calling
extract_parenthesized recursively.
(extract_ycp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-ycp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-2: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-3: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language PHP, avoid stack overflow.
Bruno Haible [Thu, 9 Mar 2023 20:23:47 +0000 (21:23 +0100)] 
xgettext: In language PHP, avoid stack overflow.

* gettext-tools/src/x-php.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, bracket_nesting_depth): New variables.
(extract_balanced): Increase and check paren_nesting_depth or
bracket_nesting_depth before calling extract_balanced recursively.
(extract_python): Initialize paren_nesting_depth and bracket_nesting_depth.
* gettext-tools/tests/xgettext-php-stackovfl-1: New file.
* gettext-tools/tests/xgettext-php-stackovfl-2: New file.
* gettext-tools/tests/xgettext-php-stackovfl-3: New file.
* gettext-tools/tests/xgettext-php-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Perl, avoid stack overflow.
Bruno Haible [Thu, 9 Mar 2023 19:28:19 +0000 (20:28 +0100)] 
xgettext: In language Perl, avoid stack overflow.

* gettext-tools/src/x-perl.c (MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(interpolate_keywords): Increase and check nesting_depth. Revert it before
returning.
(x_perl_lex): Likewise.
(extract_balanced): Increase and check nesting_depth before calling
extract_balanced recursively.
(extract_perl): Initialize nesting_depth.
* gettext-tools/tests/xgettext-perl-stackovfl-1: New file.
* gettext-tools/tests/xgettext-perl-stackovfl-2: New file.
* gettext-tools/tests/xgettext-perl-stackovfl-3: New file.
* gettext-tools/tests/xgettext-perl-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Tcl, avoid stack overflow.
Bruno Haible [Thu, 9 Mar 2023 10:34:41 +0000 (11:34 +0100)] 
xgettext: In language Tcl, avoid stack overflow.

* gettext-tools/src/x-tcl.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(bracket_nesting_depth, brace_nesting_depth): New variables.
(accumulate_word, read_word): Increase and check bracket_nesting_depth or
brace_nesting_depth before calling read_command_list recursively.
(extract_tcl): Initialize bracket_nesting_depth and brace_nesting_depth.
* gettext-tools/tests/xgettext-tcl-stackovfl-1: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-2: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-3: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Vala, avoid stack overflow.
Bruno Haible [Wed, 8 Mar 2023 20:53:49 +0000 (21:53 +0100)] 
xgettext: In language Vala, avoid stack overflow.

* gettext-tools/src/x-vala.c (MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(extract_balanced): Increase and check nesting_depth before calling
extract_balanced recursively.
(extract_vala): Initialize nesting_depth.
* gettext-tools/tests/xgettext-vala-stackovfl-1: New file.
* gettext-tools/tests/xgettext-vala-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Lua, avoid stack overflow.
Bruno Haible [Wed, 8 Mar 2023 20:37:57 +0000 (21:37 +0100)] 
xgettext: In language Lua, avoid stack overflow.

* gettext-tools/src/x-lua.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, bracket_nesting_depth): New variables.
(extract_balanced): Increase and check paren_nesting_depth or
bracket_nesting_depth before calling extract_balanced recursively.
(extract_lua): Initialize paren_nesting_depth and bracket_nesting_depth.
* gettext-tools/tests/xgettext-lua-stackovfl-1: New file.
* gettext-tools/tests/xgettext-lua-stackovfl-2: New file.
* gettext-tools/tests/xgettext-lua-stackovfl-3: New file.
* gettext-tools/tests/xgettext-lua-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language awk, avoid stack overflow.
Bruno Haible [Wed, 8 Mar 2023 19:40:35 +0000 (20:40 +0100)] 
xgettext: In language awk, avoid stack overflow.

* gettext-tools/src/x-awk.c (MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(extract_parenthesized): Increase and check nesting_depth before calling
extract_parenthesized recursively.
(extract_awk): Initialize nesting_depth.
* gettext-tools/tests/xgettext-awk-stackovfl-1: New file.
* gettext-tools/tests/xgettext-awk-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Shell, avoid stack overflow.
Bruno Haible [Wed, 8 Mar 2023 18:36:35 +0000 (19:36 +0100)] 
xgettext: In language Shell, avoid stack overflow.

* gettext-tools/src/x-sh.c (MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_word): Increase nesting_depth before calling read_command_list
recursively.
(read_command_list): Check nesting_depth.
(extract_sh): Initialize nesting_depth.
* gettext-tools/tests/xgettext-shell-stackovfl-1: New file.
* gettext-tools/tests/xgettext-shell-stackovfl-2: New file.
* gettext-tools/tests/xgettext-shell-stackovfl-3: New file.
* gettext-tools/tests/xgettext-shell-stackovfl-4: New file.
* gettext-tools/tests/xgettext-shell-stackovfl-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language librep, avoid stack overflow.
Bruno Haible [Tue, 7 Mar 2023 23:02:07 +0000 (00:02 +0100)] 
xgettext: In language librep, avoid stack overflow.

* gettext-tools/src/x-librep.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_object): Increase nesting_depth before calling read_object recursively.
Check nesting_depth.
(extract_librep): Initialize nesting_depth.
* gettext-tools/tests/xgettext-librep-stackovfl-1: New file.
* gettext-tools/tests/xgettext-librep-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language EmacsLisp, avoid stack overflow, part 2.
Bruno Haible [Tue, 7 Mar 2023 22:45:32 +0000 (23:45 +0100)] 
xgettext: In language EmacsLisp, avoid stack overflow, part 2.

* gettext-tools/src/x-elisp.c (escape_nesting_depth): New variable.
(do_getc_escaped): Increase escape_nesting_depth before calling do_getc_escaped
recursively. Check escape_nesting_depth.
(extract_elisp): Initialize escape_nesting_depth.
* gettext-tools/tests/xgettext-elisp-stackovfl-3: New file.
* gettext-tools/tests/xgettext-elisp-stackovfl-4: New file.
* gettext-tools/tests/testdata/xg-el-so-3.el: New file.
* gettext-tools/tests/testdata/xg-el-so-4.el: New file.
* gettext-tools/tests/Makefile.am (TESTS, EXTRA_DIST): Add them.

2 years agoxgettext: In language EmacsLisp, avoid stack overflow, part 1.
Bruno Haible [Tue, 7 Mar 2023 20:46:17 +0000 (21:46 +0100)] 
xgettext: In language EmacsLisp, avoid stack overflow, part 1.

* gettext-tools/src/x-elisp.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_object): Increase nesting_depth before calling read_object recursively.
Check nesting_depth.
(extract_elisp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-elisp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-elisp-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Lisp, avoid stack overflow.
Bruno Haible [Tue, 7 Mar 2023 16:16:34 +0000 (17:16 +0100)] 
xgettext: In language Lisp, avoid stack overflow.

* gettext-tools/src/x-lisp.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_object): Increase nesting_depth before calling read_object recursively.
Check nesting_depth.
(extract_lisp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-lisp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-lisp-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Scheme, avoid stack overflow.
Bruno Haible [Tue, 7 Mar 2023 15:29:17 +0000 (16:29 +0100)] 
xgettext: In language Scheme, avoid stack overflow.

* gettext-tools/src/x-scheme.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_object): Increase nesting_depth before calling read_object recursively.
Check nesting_depth.
(extract_scheme): Initialize nesting_depth.
* gettext-tools/tests/xgettext-scheme-stackovfl-1: New file.
* gettext-tools/tests/xgettext-scheme-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language JavaScript, avoid stack overflow.
Bruno Haible [Tue, 7 Mar 2023 14:59:08 +0000 (15:59 +0100)] 
xgettext: In language JavaScript, avoid stack overflow.

* gettext-tools/src/x-javascript.c (MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, bracket_nesting_depth, brace_nesting_depth,
xml_element_nesting_depth): New variables.
(extract_balanced): Increase and check paren_nesting_depth or
bracket_nesting_depth or brace_nesting_depth or xml_element_nesting_depth before
calling extract_balanced recursively.
(extract_javascript): Initialize paren_nesting_depth, bracket_nesting_depth,
brace_nesting_depth, xml_element_nesting_depth.
* gettext-tools/tests/xgettext-javascript-stackovfl-1: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-2: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-3: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-4: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-5: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-6: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-7: New file.
* gettext-tools/tests/xgettext-javascript-stackovfl-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language C#, avoid stack overflow.
Bruno Haible [Mon, 6 Mar 2023 21:21:03 +0000 (22:21 +0100)] 
xgettext: In language C#, avoid stack overflow.

* gettext-tools/src/x-csharp.c (MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, brace_nesting_depth): New variables.
(extract_parenthesized): Increase and check paren_nesting_depth or
brace_nesting_depth before calling extract_parenthesized recursively.
(extract_csharp): Initialize paren_nesting_depth and brace_nesting_depth.
* gettext-tools/tests/xgettext-csharp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-csharp-stackovfl-2: New file.
* gettext-tools/tests/xgettext-csharp-stackovfl-3: New file.
* gettext-tools/tests/xgettext-csharp-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Java, avoid stack overflow.
Bruno Haible [Mon, 6 Mar 2023 20:49:02 +0000 (21:49 +0100)] 
xgettext: In language Java, avoid stack overflow.

* gettext-tools/src/x-java.c (MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, brace_nesting_depth): New variables.
(extract_parenthesized): Increase and check paren_nesting_depth or
brace_nesting_depth before calling extract_parenthesized recursively.
(extract_java): Initialize paren_nesting_depth and brace_nesting_depth.
* gettext-tools/tests/xgettext-java-stackovfl-1: New file.
* gettext-tools/tests/xgettext-java-stackovfl-2: New file.
* gettext-tools/tests/xgettext-java-stackovfl-3: New file.
* gettext-tools/tests/xgettext-java-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language Python, avoid stack overflow.
Bruno Haible [Mon, 6 Mar 2023 19:48:35 +0000 (20:48 +0100)] 
xgettext: In language Python, avoid stack overflow.

* gettext-tools/src/x-python.c (MAX_NESTING_DEPTH): New macro.
(paren_nesting_depth, bracket_nesting_depth): New variables.
(extract_balanced): Increase and check paren_nesting_depth or
bracket_nesting_depth before calling extract_balanced recursively.
(extract_python): Initialize paren_nesting_depth and bracket_nesting_depth.
* gettext-tools/tests/xgettext-python-stackovfl-1: New file.
* gettext-tools/tests/xgettext-python-stackovfl-2: New file.
* gettext-tools/tests/xgettext-python-stackovfl-3: New file.
* gettext-tools/tests/xgettext-python-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agoxgettext: In language C, avoid stack overflow.
Bruno Haible [Mon, 6 Mar 2023 17:54:00 +0000 (18:54 +0100)] 
xgettext: In language C, avoid stack overflow.

* gettext-tools/src/x-c.c (MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(extract_parenthesized): Increase and check nesting_depth before calling
extract_parenthesized recursively.
(extract_whole_file): Initialize nesting_depth.
* gettext-tools/tests/xgettext-c-stackovfl-1: New file.
* gettext-tools/tests/xgettext-c-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agointl: Fix many warnings like "warning: "glthread_lock_init" redefined".
Bruno Haible [Mon, 6 Mar 2023 16:08:23 +0000 (17:08 +0100)] 
intl: Fix many warnings like "warning: "glthread_lock_init" redefined".

* gettext-runtime/intl/configure.ac: Move the renamings to the bottom of the
config.h file. Make the glthread*_lock* renamings conditional so that they
don't occur when these symbols are macros.

2 years agoFix potential NULL pointer dereference in ITS code
Daiki Ueno [Sun, 5 Mar 2023 01:25:16 +0000 (10:25 +0900)] 
Fix potential NULL pointer dereference in ITS code

Reported by Shashank in: <https://savannah.gnu.org/bugs/?63529> and
<https://savannah.gnu.org/bugs/?63530>.

* gettext-tools/src/locating-rule.c (get_attribute): Check return
value of xmlGetProp.
(document_locating_rule_match): Check return value of
xmlDocGetRootElement.
(locating_rule_list_add_from_file): Likewise.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2 years agoDistribute the source code of csharpexec-test.exe.
Bruno Haible [Sun, 26 Feb 2023 10:41:18 +0000 (11:41 +0100)] 
Distribute the source code of csharpexec-test.exe.

Reported by Bastien Roucariès <rouca@debian.org>
via Santiago Vila <sanvila@debian.org>
in <https://lists.gnu.org/archive/html/bug-gettext/2023-02/msg00016.html>.

* gettext-tools/m4/csharpexec-test.cs: New file, extracted from pre-2018
versions of gnulib/m4/csharpcomp.m4.
* gettext-tools/m4/Makefile.am (EXTRA_DIST): Add it.

2 years agoFix a comment.
Bruno Haible [Sun, 19 Feb 2023 10:30:31 +0000 (11:30 +0100)] 
Fix a comment.

* gettext-runtime/intl/printf.c: Fix a typo in comment.

2 years agoAM_GNU_GETTEXT: Use new build-to-host.m4 from gnulib.
Bruno Haible [Sun, 19 Feb 2023 05:37:24 +0000 (06:37 +0100)] 
AM_GNU_GETTEXT: Use new build-to-host.m4 from gnulib.

* autogen.sh: Copy m4/build-to-host.m4 from gnulib.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Add build-to-host.m4.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Simplify and fix bug on
Cygwin, by invoking gl_BUILD_TO_HOST.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Add build-to-host.m4.
* gettext-tools/misc/gettextize.in (m4filelist): Add build-to-host.m4.
* Makefile.am (distcheck-hook): Check also build-to-host.m4.
* gettext-tools/doc/gettext.texi (aclocal): Mention also build-to-host.m4.
* PACKAGING: Mention build-to-host.m4.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sat, 18 Feb 2023 16:20:17 +0000 (17:20 +0100)] 
Update to the newest gnulib.

2 years agoImprove 'git diff' of *.texi and *.m4 files.
Bruno Haible [Fri, 17 Feb 2023 22:20:55 +0000 (23:20 +0100)] 
Improve 'git diff' of *.texi and *.m4 files.

2 years agolibtextstyle: Turn off hyperlinks on the Solaris console.
Bruno Haible [Mon, 13 Feb 2023 22:05:20 +0000 (23:05 +0100)] 
libtextstyle: Turn off hyperlinks on the Solaris console.

The Solaris 11 console prints garbage when a hyperlink is output.
Tested on Solaris 11.4/x86 and Solaris 11 OmniOS/x86.

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (should_enable_hyperlinks):
Return false for the Solaris console.

2 years agobuild: Fix libgettexpo linking.
Bruno Haible [Mon, 13 Feb 2023 12:29:05 +0000 (13:29 +0100)] 
build: Fix libgettexpo linking.

* gettext-tools/libgettextpo/Makefile.am: Pass $(LTLIBUNISTRING) in
libgettextpo_la_LDFLAGS, not libgettextpo_la_LIBADD. This is needed per the
documentation
https://www.gnu.org/software/automake/manual/html_node/Libtool-Flags.html, and
also for consistency with how we handle the dependencies to libintl and
libiconv.

2 years agodoc: Assume the user has Autoconf ≥ 2.60.
Bruno Haible [Mon, 13 Feb 2023 10:48:12 +0000 (11:48 +0100)] 
doc: Assume the user has Autoconf ≥ 2.60.

* gettext-tools/doc/gettext.texi (src/Makefile): Remove obsolete advice.

2 years agoUpdate doc after recent AM_GNU_GETTEXT change.
Bruno Haible [Mon, 13 Feb 2023 10:45:52 +0000 (11:45 +0100)] 
Update doc after recent AM_GNU_GETTEXT change.

* gettext-tools/doc/gettext.texi (src/Makefile): Use $(localedir_c_make) instead
of $(localedir).

2 years agoFix "make distcheck" after gnulib changed.
Bruno Haible [Mon, 13 Feb 2023 09:27:41 +0000 (10:27 +0100)] 
Fix "make distcheck" after gnulib changed.

* gettext-runtime/m4/fcntl-o.m4: Trivial update from gnulib.
* gettext-runtime/m4/flexmember.m4: Likewise.
* gettext-runtime/m4/iconv.m4: Likewise.
* gettext-runtime/m4/intlmacosx.m4: Likewise.
* gettext-runtime/m4/inttypes_h.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.
* gettext-runtime/m4/size_max.m4: Likewise.
* gettext-runtime/m4/stdint_h.m4: Likewise.
* gettext-runtime/m4/xsize.m4: Likewise.

2 years agobuild: Don't hint to --with-installed-csharp-dll when C# support is disabled.
Bruno Haible [Mon, 13 Feb 2023 00:31:53 +0000 (01:31 +0100)] 
build: Don't hint to --with-installed-csharp-dll when C# support is disabled.

When --disable-csharp was specified, gettext-tools/src/Makefile.am does not
produce msgunfmt.net.exe. Therefore it is irrelevant whether the condition
USE_INSTALLED_CSHARP_DLL evaluates to true or false. Thus the message
"WARNING: When building the gettext-tools package without building the entire
 gettext package, you need to pass the --with-installed-csharp-dll option to
 configure."
is pointless.

Reported by Ryan Schmidt in <https://savannah.gnu.org/bugs/?58668>.

* gettext-tools/configure.ac: Don't emit hint to use --with-installed-csharp-dll
when BUILDCSHARP is not 'yes'.

2 years agointl: Simplify function prefixes.
Bruno Haible [Sat, 11 Feb 2023 22:56:19 +0000 (23:56 +0100)] 
intl: Simplify function prefixes.

* gettext-runtime/intl/configure.ac: Remove macro definitions of
_nl_locale_name_canonicalize, _nl_locale_name_from_win32_LANGID,
_nl_locale_name_from_win32_LCID, _nl_locale_name_thread_unsafe,
_nl_locale_name_posix, _nl_locale_name_default.
* gettext-runtime/intl/gettextP.h: Update declarations.
* gettext-runtime/intl/langprefs.c: Likewise.
(_nl_language_preferences_win32_mui, _nl_language_preferences_win32_ME,
_nl_language_preferences_win32_95, _nl_language_preferences_default): Use
gl_ prefixed symbols instead.
* gettext-runtime/intl/dcigettext.c (DCIGETTEXT, guess_category_value):
Likewise.

2 years agointl: Remove most of the exported _nl_* symbols, also on AIX and Solaris.
Bruno Haible [Sat, 11 Feb 2023 22:21:47 +0000 (23:21 +0100)] 
intl: Remove most of the exported _nl_* symbols, also on AIX and Solaris.

* gettext-runtime/intl/configure.ac: Map most of the _nl_* symbols to
_libintl_* symbols, so that they are not exported from libintl.

2 years agoAM_GNU_GETTEXT: Define localedir_c and localedir_c_make.
Bruno Haible [Sat, 11 Feb 2023 16:17:05 +0000 (17:17 +0100)] 
AM_GNU_GETTEXT: Define localedir_c and localedir_c_make.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Define and substitute
localedir_c and localedir_c_make.
* gettext-runtime/src/Makefile.am (AM_CPPFLAGS): Use $(localedir_c_make)
instead of $(localedir). This is useful in native Windows environments.
* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/src/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/tests/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/doc/gettext.texi (AM_GNU_GETTEXT): Small updates. Mention
localedir_c and localedir_c_make.
* NEWS: Mention the change.

2 years agoFix compilation errors with ISO C 23 compilers.
Bruno Haible [Thu, 9 Feb 2023 15:58:20 +0000 (16:58 +0100)] 
Fix compilation errors with ISO C 23 compilers.

* gettext-runtime/intl/dcigettext.c (getwd, getcwd): Assume a declaration in the
system header files.
* gettext-runtime/intl/gettextP.h (SWAP): Drop K&C compatibility.

2 years agomsggrep: Remove unused code.
Bruno Haible [Sat, 4 Feb 2023 00:12:09 +0000 (01:12 +0100)] 
msggrep: Remove unused code.

* gettext-tools/src/msggrep.c (nonintr_close, close): Remove.

2 years agoDocument that MSVC cannot be used to build shared libraries.
Bruno Haible [Sun, 12 Feb 2023 21:18:40 +0000 (22:18 +0100)] 
Document that MSVC cannot be used to build shared libraries.

Binaries crash when they are linked to intl-8.dll. Whereas binaries
don't crash when merely linked to iconv-2.dll.

I have debugged this problem for several hours, and think it is a
problem either in libtool or in the Microsoft linker.

* INSTALL.windows: Mention to use --disable-shared with MSVC.

2 years agolibtextstyle: Fix .gitignore.
Bruno Haible [Fri, 3 Feb 2023 15:46:52 +0000 (16:46 +0100)] 
libtextstyle: Fix .gitignore.

2 years agolibtextstyle: Fix compilation error on Android.
Bruno Haible [Mon, 2 Jan 2023 07:33:10 +0000 (08:33 +0100)] 
libtextstyle: Fix compilation error on Android.

* libtextstyle/gnulib-local/m4/libglib.m4 (gl_LIBGLIB): Test whether struct
lconv has a 'decimal_point' field.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_ascii_strtod,
g_ascii_formatd): If struct lconv does not have a 'decimal_point' field, use "."
instead.

2 years agoFix compilation error on Cygwin.
Bruno Haible [Fri, 10 Feb 2023 01:36:22 +0000 (02:36 +0100)] 
Fix compilation error on Cygwin.

The error occurred because Gnulib's error.h currently does not
and HAVE_ERROR=0. In this case we shouldn't force the creation of error.h.

* gettext-tools/configure.ac: Don't set ac_cv_lib_error_at_line=no. This reverts
a workaround from 2012-12-25.

2 years agoUpdate after gnulib changed.
Bruno Haible [Fri, 3 Feb 2023 12:36:32 +0000 (13:36 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/configure.ac: Test also REPLACE_TWALK.
* gettext-tools/src/po-xerror.c: Don't include "getprogname.h".
* gnulib-local/lib/xerror.c: Likewise.
* gnulib-local/lib/error-progname.c: Include <stdlib.h> instead of
getprogname.h.
* gnulib-local/lib/error.in.h.diff: Renamed from gnulib-local/lib/error.h.diff.
* gnulib-local/Makefile.am (EXTRA_DIST): Update.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Update comment.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Fri, 3 Feb 2023 11:59:59 +0000 (12:59 +0100)] 
Update to the newest gnulib.

2 years agoUpdate .gitignore after build system changes in gettext-runtime/intl/.
Bruno Haible [Fri, 3 Feb 2023 15:53:13 +0000 (16:53 +0100)] 
Update .gitignore after build system changes in gettext-runtime/intl/.

2 years agointl: Fix generation of libgnuintl.h (regression from 2022-07-17).
Bruno Haible [Fri, 3 Feb 2023 22:44:07 +0000 (23:44 +0100)] 
intl: Fix generation of libgnuintl.h (regression from 2022-07-17).

* gettext-runtime/intl/Makefile.am (libgnuintl.h): Use a syntax that does not
require GNU sed.

2 years agoFix libintl exports after build system changes in gettext-runtime/intl/ (regression...
Bruno Haible [Sat, 11 Feb 2023 10:27:16 +0000 (11:27 +0100)] 
Fix libintl exports after build system changes in gettext-runtime/intl/ (regression 2021-06-20).

On several platforms, rpl_free was exported.
On AIX 7, also rpl_newlocale, rpl_duplocale, rpl_freelocale.

* gettext-runtime/intl/configure.ac: Map more rpl_* symbols to _libintl_*.

2 years agoUpdate after release 0.21.1 has been made.
Bruno Haible [Fri, 3 Feb 2023 11:50:58 +0000 (12:50 +0100)] 
Update after release 0.21.1 has been made.

* libtextstyle/NEWS: Update next version number.

2 years agomsgfmt: Fix -k/--keyword option handling.
Bruno Haible [Fri, 2 Dec 2022 01:52:15 +0000 (02:52 +0100)] 
msgfmt: Fix -k/--keyword option handling.

Reported by Daniel <daniel.rf710@gmail.com> in
<https://savannah.gnu.org/bugs/index.php?63455>.

* gettext-tools/src/msgfmt.c (long_options): Declare that --keyword takes an
optional argument.
(main): Recognize -k as an alternative to --keyword.
Ensure that desktop_keywords is initialized before use.
Don't set desktop_default_keywords to false when an option -kKWSPEC or
--keyword=KWSPEC is seen.
Don't destroy the desktop_keywords table too early.
Don't destroy the desktop_keywords table when the program is terminating anyway.

2 years agoIn 'trap' commands, prefer symbolic to numeric signal names.
Bruno Haible [Sat, 26 Nov 2022 16:58:32 +0000 (17:58 +0100)] 
In 'trap' commands, prefer symbolic to numeric signal names.

* libtextstyle/gnulib-local/tests/test-term-ostream-xterm.sh: Use symbolic
signal names.

2 years agoUpdate after gnulib changed.
Bruno Haible [Mon, 10 Oct 2022 09:27:45 +0000 (11:27 +0200)] 
Update after gnulib changed.

* gettext-runtime/m4/iconv.m4: Update from gnulib.

2 years agoUpdate release steps.
Bruno Haible [Sun, 9 Oct 2022 23:27:23 +0000 (01:27 +0200)] 
Update release steps.

2 years agoMerge from 0.21.x branch: Prepare for 0.21.1 release: Update examples.
Bruno Haible [Sun, 9 Oct 2022 23:26:08 +0000 (01:26 +0200)] 
Merge from 0.21.x branch: Prepare for 0.21.1 release: Update examples.

* gettext-tools/examples/hello-*/configure.{ac,in.in}: Reference gettext
version 0.21.1.

2 years agoMerge from 0.21.x branch: Prepare for 0.21.1 release: Update translations.
Bruno Haible [Sun, 9 Oct 2022 21:28:47 +0000 (23:28 +0200)] 
Merge from 0.21.x branch: Prepare for 0.21.1 release: Update translations.

* gettext-runtime/po/*.po: Update from TP.
* gettext-tools/po/*.po: Likewise.
* gettext-tools/examples/po/*.po: Likewise.
* gettext-tools/examples/po/LINGUAS: Add 'ka'.
* gettext-tools/examples/hello-*/po/LINGUAS: Likewise.
* gettext-tools/examples/Makefile.am (EXAMPLESPOFILES): Add ka.po.

2 years agoMerge from 0.21.x branch: Prepare for 0.21.1 release.
Bruno Haible [Sun, 9 Oct 2022 23:18:06 +0000 (01:18 +0200)] 
Merge from 0.21.x branch: Prepare for 0.21.1 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* NEWS, gettext-runtime/NEWS: Update.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 1:2:1.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 11:0:3.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:8:5.
* gettext-runtime/src/envsubst.c: Update copyright years of the --version output.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/gettext.sh.in: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/misc/autopoint.in: Likewise.
* gettext-tools/misc/convert-archive.in: Likewise.
* gettext-tools/misc/gettextize.in: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.21.1.
* gettext-tools/misc/autopoint.in: Allow version 0.21.1.

2 years agobuild: Simplify.
Bruno Haible [Tue, 20 Sep 2022 22:12:38 +0000 (00:12 +0200)] 
build: Simplify.

This partially reverts the commit 2020-12-28 "Update after gnulib changed:
Fix link errors on native Windows."

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Remove
strdup-posix.
* gettext-tools/libgettextpo/Makefile.am (config.h): Don't define GNULIB_GETCWD.