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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
* 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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'.
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.
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.
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.
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.