]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
5 years agoMerge from 0.20.x branch: examples: Use infrastructure from gettext version 0.20.2.
Bruno Haible [Mon, 13 Apr 2020 20:41:54 +0000 (22:41 +0200)] 
Merge from 0.20.x branch: examples: Use infrastructure from gettext version 0.20.2.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.20.2.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.

5 years agoMerge from 0.20.x branch: Prepare for 0.20.2 release.
Bruno Haible [Mon, 13 Apr 2020 13:32:22 +0000 (15:32 +0200)] 
Merge from 0.20.x branch: Prepare for 0.20.2 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 9:7:1.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.20.2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:6:5.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-runtime/src/envsubst.c: Update copyright years in --version output.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/gettext.sh.in: Likewise.
* gettext-runtime/src/ngettext.c: 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/misc/convert-archive.in: Likewise.
* gettext-tools/misc/gettextize.in: Likewise.
* gettext-tools/misc/autopoint.in: Likewise. Handle version 0.20.2.

5 years agomaint: Update download location of jdom-1.0.jar.
Bruno Haible [Mon, 13 Apr 2020 13:23:55 +0000 (15:23 +0200)] 
maint: Update download location of jdom-1.0.jar.

5 years agobuild: Fix the generation of hello-c-gnome3.pot (regression from 2019-10-04).
Bruno Haible [Tue, 14 Apr 2020 01:29:58 +0000 (03:29 +0200)] 
build: Fix the generation of hello-c-gnome3.pot (regression from 2019-10-04).

* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): Set also
GETTEXTDATADIR.

5 years agoFix a compilation error (regression from 2019-12-24).
Bruno Haible [Mon, 13 Apr 2020 12:14:20 +0000 (14:14 +0200)] 
Fix a compilation error (regression from 2019-12-24).

* gettext-tools/src/write-desktop.c: Include <stdint.h>.

5 years agointl: Drop argz processing outside of glibc.
Bruno Haible [Sun, 12 Apr 2020 17:29:36 +0000 (19:29 +0200)] 
intl: Drop argz processing outside of glibc.

* gettext-runtime/intl/l10nflist.c: Don't test HAVE_ARGZ_H.
(__argz_count, __argz_stringify, __argz_next): Remove definitions.
(_nl_make_l10nflist): Simplify !_LIBC case.
* gettext-runtime/m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't test for <argz.h>,
argz_count, argz_stringify, argz_next.

5 years agointl: Improve comments.
Bruno Haible [Sun, 12 Apr 2020 16:49:42 +0000 (18:49 +0200)] 
intl: Improve comments.

* gettext-runtime/intl/Makefile.am: Add an overview of the code.
* gettext-runtime/intl/loadinfo.h (_nl_make_l10nflist): Improve comment.
* gettext-runtime/intl/dcigettext.c (guess_category_value): Likewise.
* gettext-runtime/intl/finddomain.c (_nl_find_domain): Likewise.

5 years agopo: Emit a warning when creating a tarball without POT file.
Bruno Haible [Sat, 11 Apr 2020 21:00:21 +0000 (23:00 +0200)] 
po: Emit a warning when creating a tarball without POT file.

* gettext-runtime/po/Makefile.in.in (dist2): Emit a warning when the POT file
does not exist.
* gettext-tools/examples/hello-*/po/Makefile.am (distdir1): Likewise.

5 years agolibtextstyle: Update .gitignore after 2019-12-24 change.
Bruno Haible [Sat, 11 Apr 2020 11:16:26 +0000 (13:16 +0200)] 
libtextstyle: Update .gitignore after 2019-12-24 change.

5 years agoUpdate to newest gnulib.
Bruno Haible [Sat, 11 Apr 2020 10:09:23 +0000 (12:09 +0200)] 
Update to newest gnulib.

5 years agoxgettext: Fix a report by an undefined-behaviour sanitizer.
Bruno Haible [Fri, 10 Apr 2020 19:19:36 +0000 (21:19 +0200)] 
xgettext: Fix a report by an undefined-behaviour sanitizer.

Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-01/msg00029.html>.

* gettext-tools/src/read-properties.c (read_escaped_string): Don't call memcpy
with a NULL argument.

5 years agoxgettext: Improve JSX support in JavaScript.
Bruno Haible [Mon, 6 Apr 2020 21:29:56 +0000 (23:29 +0200)] 
xgettext: Improve JSX support in JavaScript.

Reported by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?57927>.

* gettext-tools/src/x-javascript.c (enum token_type_ty): Add some more types.
(is_after_expression): New function.
(phase5_get): Distinguish the "other" tokens in more detail. Use
'is_after_expression ()' when interpreting a '<' or '/' character.
(extract_balanced): Don't let commas in braced expressions and in XML elements
disturb the argument processing outside.
(extract_javascript): Update.
* gettext-tools/tests/xgettext-javascript-6: Enhance the test.
* NEWS: Mention the change.

5 years agoxgettext: Freshly initialize all static variables for each input file.
Bruno Haible [Mon, 6 Apr 2020 12:07:01 +0000 (14:07 +0200)] 
xgettext: Freshly initialize all static variables for each input file.

* gettext-tools/src/x-c.c (extract_whole_file): Initialize
phase1_pushback_length, phase2_pushback_length, phase3_pushback_length,
phase5_pushback_length, phase6_pushback_length.
* gettext-tools/src/x-csharp.c (extract_csharp): Initialize
phase1_pushback_length, phase2_pushback_length, phase3_pushback_length,
phase5_pushback_length, phase6_pushback_length, phase7_pushback_length.
* gettext-tools/src/x-java.c (extract_java): Initialize phase1_pushback_length,
phase2_pushback_length, phase3_pushback_length, phase5_pushback_length,
phase6_pushback_length.
* gettext-tools/src/x-javascript.c (continuation_or_nonblank_line,
last_token_type): Remove static initialization.
(extract_javascript): Initialize phase1_pushback_length, phase2_pushback_length,
phase5_pushback_length, last_token_type.
* gettext-tools/src/x-lua.c (first_character): Change type to 'bool'. Remove
static initialization.
(extract_lua): Initialize phase1_pushback_length, first_character,
phase3_pushback_length, phase4_last, phase4_pushback_length.
* gettext-tools/src/x-perl.c (extract_perl): Reorder initializations.
* gettext-tools/src/x-php.c (extract_php): Initialize phase1_pushback_length,
phase3_pushback_length, phase4_pushback_length.
* gettext-tools/src/x-python.c (continuation_or_nonblank_line): Remove static
initialization.
(extract_python): Initialize phase1_pushback_length, phase2_pushback_length,
phase5_pushback_length.
* gettext-tools/src/x-sh.c (extract_sh): Initialize phase1_pushback_length,
phase2_pushback_length.
* gettext-tools/src/x-smalltalk.c (extract_smalltalk): Initialize
phase2_pushback_length, phase3_pushback_length.
* gettext-tools/src/x-tcl.c (extract_tcl): Initialize phase1_pushback_length,
phase2_pushback_length.
* gettext-tools/src/x-vala.c (last_token_type): Remove static initialization.
(extract_vala): Initialize phase1_pushback_length, phase3_pushback_length,
last_token_type.
* gettext-tools/src/x-ycp.c (extract_ycp): Initialize phase2_pushback_length,
phase5_pushback_length, phase8_pushback_length.

5 years agopo, examples: In the .po -> .gmo rules, really consider the newest changes to the...
Bruno Haible [Sun, 5 Apr 2020 13:08:34 +0000 (15:08 +0200)] 
po, examples: In the .po -> .gmo rules, really consider the newest changes to the POT file.

Reported by Petr Ovtchenkov <ptr@void-ptr.info> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00000.html>.
Helped by Paul Smith.

* gettext-runtime/po/Makefile.in.in (.po.gmo): Write dependency on the POT file
as a target rule, since inference rules don't support prerequisites.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm
rule.
* NEWS: Mention the fix.

5 years agoThe gettext library is under LGPL 2.1, not 2.0.
Bruno Haible [Sat, 4 Apr 2020 15:28:55 +0000 (17:28 +0200)] 
The gettext library is under LGPL 2.1, not 2.0.

* gettext-runtime/m4/intl.m4: Fix comments regarding the gettext library.
* gettext-runtime/m4/intlmacosx.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/po.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.

5 years agoThe next release will be 0.20.2, not 0.21.
Bruno Haible [Sat, 4 Apr 2020 15:27:24 +0000 (17:27 +0200)] 
The next release will be 0.20.2, not 0.21.

* gettext-runtime/m4/gettext.m4: Update header comment.
* gettext-runtime/m4/intdiv0.m4: Likewise.
* gettext-tools/m4/exported.m4: Likewise.

5 years agodoc: Don't recommend to use the reserved identifier '_' in Java.
Bruno Haible [Sun, 29 Mar 2020 19:03:50 +0000 (21:03 +0200)] 
doc: Don't recommend to use the reserved identifier '_' in Java.

Reported by Akim Demaille <akim.demaille@gmail.com>.

* gettext-tools/doc/gettext.texi (Java): Use i18n instead _ as magic identifier.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sat, 28 Mar 2020 19:03:44 +0000 (20:03 +0100)] 
Update after gnulib changed.

* gnulib-local/lib/regex_internal.h.diff: Update.
* gnulib-local/lib/unistd.in.h.diff: Update.
* gettext-runtime/intl/filename.h: New file, from gnulib.
* gettext-runtime/intl/dcigettext.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH,
IS_PATH_WITH_DIR): Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New
macros.
(DCIGETTEXT): Use IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR.
* gettext-runtime/intl/l10nflist.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH):
Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
(_nl_make_l10nflist): Use IS_RELATIVE_FILE_NAME.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add filename.h.
(l10nflist.lo, dcigettext.lo): Depend on it.
* Makefile.am (distcheck-hook): Check also gettext-runtime/intl/filename.h.
* gettext-runtime/intl/lock.c: Update from gnulib.
* gettext-runtime/intl/lock.h: Likewise.
* gettext-runtime/intl/relocatable.c: Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_list_locate): Use
IS_RELATIVE_FILE_NAME instead of IS_ABSOLUTE_PATH.
* gettext-tools/src/open-catalog.c (try_open_catalog_file): Likewise.
* gettext-tools/src/xgettext.c (main, xgettext_open): Likewise.
* libtextstyle/lib/color.c (style_file_lookup): Use IS_FILE_NAME_WITH_DIR
instead of IS_PATH_WITH_DIR.

5 years agoUpdate to newest gnulib.
Bruno Haible [Sat, 28 Mar 2020 18:48:45 +0000 (19:48 +0100)] 
Update to newest gnulib.

5 years agourlget: Follow the "privacy by design" principle.
Bruno Haible [Mon, 24 Feb 2020 11:31:21 +0000 (12:31 +0100)] 
urlget: Follow the "privacy by design" principle.

* gettext-tools/src/urlget.c (fetch): Override the User-Agent string, so as not
to reveal the program version to the server. For wget, use long options.

5 years agourlget: Follow the "privacy by design" principle.
Bruno Haible [Sun, 23 Feb 2020 19:56:32 +0000 (20:56 +0100)] 
urlget: Follow the "privacy by design" principle.

* gettext-tools/src/gnu/gettext/GetURL.java (fetch): Override the User-Agent
string, so as not to reveal the Java version to the server.

5 years agolibtextstyle: Prepare intermediate release 0.20.5.
Bruno Haible [Tue, 21 Jan 2020 20:44:02 +0000 (21:44 +0100)] 
libtextstyle: Prepare intermediate release 0.20.5.

* libtextstyle/version.sh: Update version number.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 1:0:1.
* libtextstyle/NEWS: Update.
* NEWS: Likewise.

5 years agobuild: Tweak configure.ac.
Bruno Haible [Sun, 5 Jan 2020 20:53:43 +0000 (21:53 +0100)] 
build: Tweak configure.ac.

* gettext-runtime/configure.ac: Move AH_BOTTOM invocation, for consistency with
gettext-tools/configure.ac.

5 years agobuild: Fix link error on MSVC with --disable-shared.
Bruno Haible [Sun, 5 Jan 2020 19:19:17 +0000 (20:19 +0100)] 
build: Fix link error on MSVC with --disable-shared.

* gettext-tools/tests/setlocale.c (setlocale): Define to fake_setlocale on
native Windows.
* gettext-tools/tests/format-c-3-prg.c (setlocale): Likewise.
* gettext-tools/tests/format-c-4-prg.c (setlocale): Likewise.
* gettext-tools/tests/plural-1-prg.c (setlocale): Likewise.
* gettext-tools/tests/tstgettext.c (setlocale): Likewise.
* gettext-tools/tests/tstngettext.c (setlocale): Likewise.

5 years agobuild: Fix build error on MSVC with --disable-shared.
Bruno Haible [Sun, 5 Jan 2020 19:15:46 +0000 (20:15 +0100)] 
build: Fix build error on MSVC with --disable-shared.

* gettext-tools/configure.ac (AH_BOTTOM): On MSVC with --disable-shared, even
when compiling with option -MD, define DLL_VARIABLE to empty.

5 years agolibtextstyle: Enable large files and, on Linux, 64-bit inodes support.
Dmitry V. Levin [Fri, 3 Jan 2020 12:08:20 +0000 (13:08 +0100)] 
libtextstyle: Enable large files and, on Linux, 64-bit inodes support.

* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'largefile' to enable
large files support on systems where this is not the default and 64-bit
inodes in 32-bit applications on Linux.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 5 Jan 2020 19:11:22 +0000 (20:11 +0100)] 
Update after gnulib changed.

5 years agoUpdate after gnulib changed.
Bruno Haible [Thu, 2 Jan 2020 13:54:32 +0000 (14:54 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/localcharset.c: Update from gnulib.
* gettext-runtime/intl/setlocale-lock.c: Likewise.

5 years agoUpdate to newest gnulib.
Bruno Haible [Tue, 24 Dec 2019 20:56:26 +0000 (21:56 +0100)] 
Update to newest gnulib.

5 years agoFix a test failure of msgfmt-desktop-2 on HP-UX with cc.
Bruno Haible [Tue, 24 Dec 2019 19:02:27 +0000 (20:02 +0100)] 
Fix a test failure of msgfmt-desktop-2 on HP-UX with cc.

* gettext-tools/src/write-desktop.c (msgfmt_desktop_handle_pair): Don't cast
directly from 'void *' to 'bool'.

5 years agoUpdate after gnulib changed: Support building with --enable-threads=isoc.
Bruno Haible [Tue, 24 Dec 2019 16:37:22 +0000 (17:37 +0100)] 
Update after gnulib changed: Support building with --enable-threads=isoc.

* gettext-runtime/intl/dcigettext.c (lock): Move outside _nl_find_msg.
* gettext-runtime/intl/finddomain.c (lock): Move outside _nl_find_domain.
* gettext-runtime/intl/loadmsgcat.c (lock): Move outside _nl_load_domain.

5 years agoUpdate after gnulib changed: Fix test failures on FreeBSD, NetBSD, macOS.
Bruno Haible [Tue, 24 Dec 2019 16:37:19 +0000 (17:37 +0100)] 
Update after gnulib changed: Fix test failures on FreeBSD, NetBSD, macOS.

* gettext-tools/tests/setlocale.c (setlocale): Undefine.

5 years agoUpdate after gnulib changed.
Bruno Haible [Tue, 24 Dec 2019 16:37:17 +0000 (17:37 +0100)] 
Update after gnulib changed.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Add
setlocale-null.
* gettext-runtime/intl/localcharset.h: Update from gnulib.
* gettext-runtime/intl/localcharset.c: Likewise.
* gettext-runtime/intl/localename.c: Likewise.
* gettext-runtime/intl/setlocale_null.h: New file, from gnulib.
* gettext-runtime/intl/arg-nonnull.h: New file, from gnulib.
* gettext-runtime/intl/setlocale_null.c: New file, from gnulib.
* gettext-runtime/intl/setlocale-lock.c: New file, from gnulib.
* gettext-runtime/intl/lock.h: Update from gnulib.
* gettext-runtime/intl/lock.c: Likewise.
* gettext-runtime/intl/threadlib.c: Likewise.
* gettext-runtime/intl/vasnprintf.c: Likewise.
* gettext-runtime/intl/verify.h: Likewise.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add arg-nonnull.h,
setlocale_null.h.
(LIBINTLSOURCES): Add setlocale-lock.c, setlocale_null.c.
(setlocale-lock.lo, setlocale_null.lo): New rules.
(localename.lo, setlocale-lock.lo, setlocale_null.lo): Update dependencies.
* Makefile.am (distcheck-hook): Check the new files in gettext-runtime/intl/.
* gettext-runtime/libasprintf/vasnprintf.c: Update from gnulib.
* gettext-tools/libgettextpo/Makefile.am (DEFS): Define OMIT_SETLOCALE_LOCK.
* gettext-runtime/NEWS: Mention the multithread-safety fix in localcharset.c.
* NEWS: Likewise.

5 years agoUpdate to newest gnulib.
Bruno Haible [Tue, 24 Dec 2019 16:37:09 +0000 (17:37 +0100)] 
Update to newest gnulib.

5 years agoFix test failures on Haiku.
Bruno Haible [Tue, 24 Dec 2019 16:37:07 +0000 (17:37 +0100)] 
Fix test failures on Haiku.

* gettext-tools/tests/init.cfg (func_filter_POT_Creation_Date): New function.
* gettext-tools/tests/xgettext-*: Use it.

5 years agobuild: Fix build failures on HP-UX 11.31/hppa with cc.
Bruno Haible [Tue, 24 Dec 2019 16:37:04 +0000 (17:37 +0100)] 
build: Fix build failures on HP-UX 11.31/hppa with cc.

* gnulib-local/lib/libxml/parser.c (struct _xmlDefAttrs): Don't use ISO C 99
syntax with this compiler.
* gettext-runtime/intl/plural-exp.h (HAVE_STRUCT_INITIALIZER): Set to 0 with
this compiler.

5 years agolibtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.
Bruno Haible [Tue, 24 Dec 2019 16:37:00 +0000 (17:37 +0100)] 
libtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.

* libtextstyle/lib/Makefile.am (libtextstyle.sym.in): Test the exit status of
the declared.sh command. Preserve the existing libunistring.sym if it failed.

5 years agolibcroco: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 23:40:08 +0000 (00:40 +0100)] 
libcroco: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* libtextstyle/gnulib-local/lib/libcroco/*: Inline the COPYRIGHT file where
applicable. Add copyright header.
* libtextstyle/gnulib-local/lib/libcroco/libcroco-config.h: Add copyright header.

5 years agolibxml: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 18:57:37 +0000 (19:57 +0100)] 
libxml: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* gnulib-local/lib/libxml/*: Inline this directory's COPYING file where
applicable. Add FSF copyright header.
* gnulib-local/lib/libxml/trionan.c: Add copyright header.

5 years agoglib: Improve copyright headers.
Bruno Haible [Sun, 24 Nov 2019 18:53:45 +0000 (19:53 +0100)] 
glib: Improve copyright headers.

The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.

* libtextstyle/gnulib-local/lib/glib*: Add FSF copyright header.

5 years agolibtextstyle: Add test for ostream_printf.
Bruno Haible [Mon, 28 Oct 2019 00:11:21 +0000 (01:11 +0100)] 
libtextstyle: Add test for ostream_printf.

* libtextstyle/gnulib-local/tests/test-memory-ostream.c: New file.
* libtextstyle/gnulib-local/modules/memory-ostream-tests: New file.
* libtextstyle/Makefile.am (EXTRA_DIST): Add them.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'memory-ostream-tests'.

5 years agolibtextstyle: Add ostream_printf, ostream_vprintf functions.
Bruno Haible [Mon, 28 Oct 2019 00:08:41 +0000 (01:08 +0100)] 
libtextstyle: Add ostream_printf, ostream_vprintf functions.

Suggested by José Marchesi.

* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'vasprintf-posix'.
* libtextstyle/gnulib-local/lib/ostream.oo.h: Include <stdarg.h>.
(ostream_printf, ostream_vprintf): New declarations.
* libtextstyle/gnulib-local/lib/ostream.oo.c: Include <stdio.h>.
(ostream_printf, ostream_vprintf): New functions.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.h: Update comments.
* libtextstyle/gnulib-local/lib/term-ostream.oo.h: Likewise.
* libtextstyle/gnulib-local/lib/html-ostream.oo.h: Likewise.
* libtextstyle/lib/textstyle.h: Include <stdio.h>.
(ostream_printf, ostream_vprintf): New functions.
(styled_ostream_flush_to_current_style, term_ostream_flush_to_current_style,
html_ostream_flush_to_current_style): Update comments.
* libtextstyle/doc/libtextstyle.texi (The ostream class): Document
ostream_printf, ostream_vprintf.
(The styled_ostream class, The term_ostream class, The html_ostream class):
Update comments.
* libtextstyle/NEWS: Mention it.
* NEWS: Likewise.

5 years agolibtextstyle: Clarify memory_stream_contents function.
Bruno Haible [Sun, 27 Oct 2019 23:55:05 +0000 (00:55 +0100)] 
libtextstyle: Clarify memory_stream_contents function.

* libtextstyle/gnulib-local/lib/memory-ostream.oo.h (memory_stream::contents):
Clarify extent of return values.
* libtextstyle/doc/libtextstyle.texi (The memory_ostream class): Likewise.

5 years agobuild: Fix typo in comment.
Bruno Haible [Sun, 27 Oct 2019 23:10:15 +0000 (00:10 +0100)] 
build: Fix typo in comment.

* gettext-tools/gnulib-tests/Makefile.am: Fix typo.
* libtextstyle/adhoc-tests/Makefile.am: Likewise.
* libtextstyle/tests/Makefile.am: Likewise.

5 years agodoc: Add more info for language implementors.
Bruno Haible [Sun, 20 Oct 2019 15:08:30 +0000 (17:08 +0200)] 
doc: Add more info for language implementors.

* gettext-tools/doc/gettext.texi (Language Implementors): Add more details.

5 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 13 Oct 2019 18:25:46 +0000 (20:25 +0200)] 
Update after gnulib changed.

* gettext-runtime/intl/localcharset.c: Update from gnulib.
* gettext-runtime/intl/verify.h: Likewise.

5 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 13 Oct 2019 15:35:17 +0000 (17:35 +0200)] 
Update to the newest gnulib.

5 years agodoc: Mention continuous integration.
Bruno Haible [Mon, 7 Oct 2019 12:30:43 +0000 (14:30 +0200)] 
doc: Mention continuous integration.

* HACKING: Mention continuous integration.

5 years agobuild: Fix failure to build the doc in a VPATH build.
Bruno Haible [Sun, 6 Oct 2019 12:54:30 +0000 (14:54 +0200)] 
build: Fix failure to build the doc in a VPATH build.

* gettext-tools/doc/Makefile.am ($(srcdir)/stamp-vti): Create version.texi in
the source directory.

5 years agoxgettext: Fix bug in shell script parser (regression from 2019-09-15).
Bruno Haible [Sun, 6 Oct 2019 02:20:01 +0000 (04:20 +0200)] 
xgettext: Fix bug in shell script parser (regression from 2019-09-15).

* gettext-tools/src/x-sh.c (read_command): Set matters_for_argparser = false
when context_iter is not being initialized.

5 years agoCorrect indentation.
Bruno Haible [Sun, 6 Oct 2019 01:40:09 +0000 (03:40 +0200)] 
Correct indentation.

* gettext-tools/src/x-scheme.c (read_object): Correct indentation.

5 years agodoc: Mention packages needed for Javascript support.
Bruno Haible [Sat, 5 Oct 2019 13:59:01 +0000 (15:59 +0200)] 
doc: Mention packages needed for Javascript support.

* HACKING: Mention the gir1.2-gtk-3.0 package alongside with gjs.

5 years agodoc: Don't need an ar_SA locale.
Bruno Haible [Fri, 4 Oct 2019 20:02:46 +0000 (22:02 +0200)] 
doc: Don't need an ar_SA locale.

* HACKING: Remove command that creates an ar_SA locale.

5 years agodoc: Update list of external dependencies.
Bruno Haible [Fri, 4 Oct 2019 18:22:33 +0000 (20:22 +0200)] 
doc: Update list of external dependencies.

* DEPENDENCIES: Don't list glib2 and libcroco (not needed any more since
2019-02-15).

5 years agobuild: Fix the build error in gettext-tools/examples/po.
Bruno Haible [Fri, 4 Oct 2019 15:59:22 +0000 (17:59 +0200)] 
build: Fix the build error in gettext-tools/examples/po.

Reported by Nick Alcock <nix@esperi.org.uk>
at <https://savannah.gnu.org/bugs/?56529>.

* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): New variable.
(hello-*.pot): Use it.
($(srcdir)/../hello-*/po/$(LL).po): Likewise.
* HACKING: Remove the workaround.

5 years agoMake it easier to build the code when the documentation tools don't work.
Bruno Haible [Fri, 4 Oct 2019 15:26:08 +0000 (17:26 +0200)] 
Make it easier to build the code when the documentation tools don't work.

* libtextstyle/Makefile.am (SUBDIRS): Move 'doc' to the end.

5 years agolibxml: Simplify autoconf macro.
Bruno Haible [Fri, 4 Oct 2019 11:20:12 +0000 (13:20 +0200)] 
libxml: Simplify autoconf macro.

* gnulib-local/m4/libxml.m4 (gl_LIBXML): Don't test for dlopen and shlload.
The test for dlopen failed, because it would require linking with '-ldl'.
The test for shlload failed, because the function on HP-UX is called 'shl_load'
and it would require linking with '-ldld'.

5 years agobuild: Don't fetch gnulib a second time in libtextstyle.
Bruno Haible [Fri, 4 Oct 2019 09:47:18 +0000 (11:47 +0200)] 
build: Don't fetch gnulib a second time in libtextstyle.

* autogen.sh: Set GNULIB_SRCDIR when invoking libtextstyle/autogen.sh.
* libtextstyle/autogen.sh: Remove all git operations. Look at the GNULIB_SRCDIR
environment variable. Ignore the GNULIB_TOOL environment variable.

5 years agolibtextstyle: Fix failure to download texinfo.tex.
Bruno Haible [Fri, 4 Oct 2019 09:36:40 +0000 (11:36 +0200)] 
libtextstyle: Fix failure to download texinfo.tex.

* libtextstyle/autogen.sh: Create build-aux directory.

5 years agoUpdate NEWS file.
Bruno Haible [Sun, 29 Sep 2019 22:07:30 +0000 (00:07 +0200)] 
Update NEWS file.

* NEWS: Include the news about libtextstyle.

5 years agoxgettext: Signal a warning when the same msgid is used with and without plural.
Bruno Haible [Sun, 29 Sep 2019 18:52:48 +0000 (20:52 +0200)] 
xgettext: Signal a warning when the same msgid is used with and without plural.

* gettext-tools/src/xg-message.h (remember_a_message): Add pluralp argument.
* gettext-tools/src/xg-message.c (remember_a_message): Likewise. Signal a
warning when the same msgid is used with and without plural.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update
remember_a_message invocation.
* gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Update
remember_a_message invocations.
* gettext-tools/src/x-awk.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Likewise.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords,
extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_word, read_command): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-smalltalk.c (phase3_pushback, phase3_pushback_length): New
variables.
(phase3_get): Renamed from x_smalltalk_lex. Handle pushback.
(phase3_unget): New function.
(extract_smalltalk): Update remember_a_message invocations through a lookahead
of one token.
* gettext-tools/src/x-ycp.c (phase8_pushback, phase8_pushback_length): New
variables.
(phase8_get): Handle pushback.
(phase8_unget): New function.
(extract_parenthesized): Update remember_a_message invocations through a
lookahead of one token.
* gettext-tools/tests/xgettext-15: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

5 years agomsgcat: Signal error when the same msgid is used with and without msgid_plural.
Bruno Haible [Sun, 29 Sep 2019 18:20:36 +0000 (20:20 +0200)] 
msgcat: Signal error when the same msgid is used with and without msgid_plural.

Suggested by Mikko Rantalainen <mikko.rantalainen@peda.net>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-09/msg00020.html>.

* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Signal an error when
the same msgid is used with and without msgid_plural.
* gettext-tools/src/msgcat.c (main): Exit with failure code if there was an
error.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/tests/msgcat-21: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

5 years agolibxml: Fix buffer overrun.
Bruno Haible [Sun, 29 Sep 2019 14:50:15 +0000 (16:50 +0200)] 
libxml: Fix buffer overrun.

Reported by GCC 8 -Wformat-truncation warning.

* gnulib-local/lib/libxml/parser.c (xmlParseReference): Increase size of buffer
'out' to 12 bytes.

5 years agoxgettext: Fix parsing of XML tags.
Bruno Haible [Sun, 29 Sep 2019 12:35:37 +0000 (14:35 +0200)] 
xgettext: Fix parsing of XML tags.

* gettext-tools/src/x-javascript.c (phase5_get): Fix lexical_context after
decrementing xml_element_depth.

5 years agoxgettext: Fix parsing of XML tags that end in /> and have attributes.
Bruno Haible [Sun, 29 Sep 2019 12:29:41 +0000 (14:29 +0200)] 
xgettext: Fix parsing of XML tags that end in /> and have attributes.

Reported by Matej Marusak <marusak.matej@gmail.com>
in <https://savannah.gnu.org/bugs/?56848>.

* gettext-tools/src/x-javascript.c (phase5_get): After reading a string, reset
the lexical_context to the previous one, not to lc_outside. When reading /> at
the end of an XML element, decrement xml_element_depth.
* gettext-tools/tests/xgettext-javascript-6: Add a test.

5 years agoxgettext: Recognize text blocks in Java parser.
Bruno Haible [Sun, 29 Sep 2019 10:58:09 +0000 (12:58 +0200)] 
xgettext: Recognize text blocks in Java parser.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add
unictype/syntax-java-whitespace.
* gettext-tools/src/x-java.c: Include unictype.h.
(strip_indent): New function.
(phase5_get): Parse text blocks (Java 13 syntax).
* gettext-tools/tests/xgettext-java-2: Add tests of text blocks.
* gettext-tools/doc/gettext.texi (Java): Mention the text block syntax.
* NEWS: Mention the change.

5 years agoxgettext: Verify parsing of JavaScript template literals inside objects.
Bruno Haible [Sun, 29 Sep 2019 08:54:32 +0000 (10:54 +0200)] 
xgettext: Verify parsing of JavaScript template literals inside objects.

Reported by Andy Holmes <andrew.g.r.holmes@gmail.com>
in <https://savannah.gnu.org/bugs/?50920>.

* gettext-tools/tests/xgettext-javascript-7: Test template literals inside an
object.

5 years agoxgettext: Recognize 'env' and assignments in Shell scripts.
Bruno Haible [Mon, 16 Sep 2019 00:47:44 +0000 (02:47 +0200)] 
xgettext: Recognize 'env' and assignments in Shell scripts.

Reported by Jason Vas Dias <jason.vas.dias@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-08/msg00032.html>.

* gettext-tools/src/x-sh.c (enum word_type): Add t_assignment.
(read_word): Recognize assignments.
(read_command): In a function position, ignore assignments and 'env' tokens.
* gettext-tools/tests/xgettext-sh-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

5 years agoDocument improvement done on 2019-05-20.
Bruno Haible [Sun, 15 Sep 2019 23:45:20 +0000 (01:45 +0200)] 
Document improvement done on 2019-05-20.

* gettext-runtime/NEWS: Document improvement.
* NEWS: Likewise.

5 years agobuild: Install gettext.h with the LGPL license header, not with the GPL header.
Bruno Haible [Sat, 14 Sep 2019 13:25:36 +0000 (15:25 +0200)] 
build: Install gettext.h with the LGPL license header, not with the GPL header.

Reported by Joachim Metz <joachim.metz@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2012-09/msg00000.html>.

* gettext-tools/gnulib-lib/Makefile.am (gettextsrcdir, gettextsrc_DATA): Remove
variables.
* gnulib-local/Makefile.am (gettextsrcdir, gettextsrc_DATA): Define them here.

5 years agoClarify license of gettext.m4.
Bruno Haible [Sat, 14 Sep 2019 13:20:21 +0000 (15:20 +0200)] 
Clarify license of gettext.m4.

* gettext-runtime/m4/gettext.m4: Update comments: libintl is under LGPLv2.1+.

5 years agobuild: Avoid failing a configure test due to CFLAGS="-Werror".
Bruno Haible [Sat, 14 Sep 2019 11:30:24 +0000 (13:30 +0200)] 
build: Avoid failing a configure test due to CFLAGS="-Werror".

Reported by Florian Weimer <fweimer@redhat.com>.

* gettext-runtime/m4/intdiv0.m4 (gt_INTDIV0): In the test program, include
<unistd.h>, for the declaration of _exit().

5 years agobuild: Add support for shallow-cloning of subdirectories.
Bruno Haible [Sun, 1 Sep 2019 15:51:31 +0000 (17:51 +0200)] 
build: Add support for shallow-cloning of subdirectories.

* gitsub.sh (func_usage): Document allowed git options with 'git pull'.
(func_pull): Accept GIT_OPTIONS argument.
(pull): Parse git options before complaining about too many arguments.
Pass the git options to func_pull.

5 years agoxgettext: Assume that Python source files are in UTF-8 by default.
Bruno Haible [Sun, 25 Aug 2019 21:37:44 +0000 (23:37 +0200)] 
xgettext: Assume that Python source files are in UTF-8 by default.

Reported by ilias iliadis <apiuano-bugs@yahoo.gr>
at <https://savannah.gnu.org/bugs/?55231>.

* gettext-tools/src/xg-encoding.h (xgettext_global_source_encoding): Allow a
NULL value.
* gettext-tools/src/xg-encoding.c (xgettext_global_source_encoding): Likewise.
* gettext-tools/src/xgettext.c (main): Initialize
xgettext_global_source_encoding with NULL, not "ASCII". Handle a NULL
xgettext_global_source_encoding.
(extract_from_file): Use ASCII as default for xgettext_global_source_encoding.
* gettext-tools/src/x-javascript.c (extract_javascript): Likewise.
* gettext-tools/src/x-python.c (phase2_getc): Signal an error when encountering
an invalid or incomplete UTF-8 character.
(set_current_file_source_encoding): In the error message, use
xgettext_current_file_source_encoding instead of
xgettext_global_source_encoding.
(extract_python): Use UTF-8 as default for xgettext_global_source_encoding.
* gettext-tools/tests/xgettext-python-3: Verify that if the source file has no
magic coding comment but is UTF-8 encoded, xgettext succeeds.
* NEWS: Mention the change.

5 years agoAdd support for Java format strings in the Formatter syntax.
Bruno Haible [Sun, 25 Aug 2019 17:17:21 +0000 (19:17 +0200)] 
Add support for Java format strings in the Formatter syntax.

* gettext-tools/src/message.h (format_type): Add format_java_printf.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add
entry for format_java_printf.
* gettext-tools/src/format.h (formatstring_java_printf): New declaration.
* gettext-tools/src/format-java.c: Update comments.
* gettext-tools/src/format-java-printf.c: New file.
* gettext-tools/src/format.c (formatstring_parsers): Add entry for
format_java_printf.
* gettext-tools/src/x-java.h (SCANNERS_JAVA): Use formatstring_java_printf.
* gettext-tools/src/x-java.c (init_flag_table_java): Add entries relevant to
format strings in Formatter syntax.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Add support for
format_java_printf.
* gettext-tools/src/FILES: Add format-java-printf.c.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-java-printf.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_java_printf.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/tests/xgettext-6 (xg-test6.java): Add test for recognition of
format strings in Formatter syntax.
* gettext-tools/tests/format-java-printf-1: New file.
* gettext-tools/tests/format-java-printf-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/tests/lang-java: Add two uses of String.format to the program.
* gettext-tools/doc/gettext.texi (PO Files): Document java-printf-format and
no-java-printf-format.
(java-format): Describe both kinds of format strings. Update URLs.
(Java): Mention the second kind of format string as well.
* NEWS: Mention the improvement.

5 years agotests: Remove comments about GCJ.
Bruno Haible [Sun, 25 Aug 2019 17:00:26 +0000 (19:00 +0200)] 
tests: Remove comments about GCJ.

We don't support GCJ any more since 2017-05-04.

* gettext-tools/tests/lang-java: Remove comment about failure with GCJ.
* gettext-tools/tests/msgunfmt-java-1: Likewise.

5 years agoUpdate compile-command in comments.
Bruno Haible [Sun, 25 Aug 2019 14:21:09 +0000 (16:21 +0200)] 
Update compile-command in comments.

* gettext-tools/src/format-*.c: Fix -I options in compile-command.

5 years agodesktop: Small parser fix.
Bruno Haible [Sun, 25 Aug 2019 09:46:48 +0000 (11:46 +0200)] 
desktop: Small parser fix.

* gettext-tools/src/read-desktop.c (desktop_lex): Fix handling of control
characters in group names.

5 years agocode style: Avoid gratuitous 'continue;' statements.
Bruno Haible [Sun, 25 Aug 2019 09:38:22 +0000 (11:38 +0200)] 
code style: Avoid gratuitous 'continue;' statements.

* gettext-tools/src/file-list.c (read_names_from_file): Use 'if' instead of
'continue'.
* gettext-tools/src/its.c (its_rule_list_add_from_doc): Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_list_add_from_file):
Likewise.
* gettext-tools/src/msgfmt.c (get_languages): Likewise.
* gettext-tools/src/x-javascript.c (phase5_scan_xml_markup): Likewise.
* gettext-tools/src/x-lua.c (phase2_getc): Likewise.
* gettext-tools/src/read-desktop.c (desktop_lex): Use 'if' instead of 'switch'
with few alternatives. Test for EOF first.

5 years agoautogen.sh: Make more reliable.
Bruno Haible [Sat, 24 Aug 2019 17:25:06 +0000 (19:25 +0200)] 
autogen.sh: Make more reliable.

* autogen.sh: Really bail out if gnulib-tool fails to copy config.{guess,sub}.

6 years agoxgettext: Handle newlines in Lua long bracket literal strings correctly.
Bruno Haible [Thu, 22 Aug 2019 14:36:59 +0000 (16:36 +0200)] 
xgettext: Handle newlines in Lua long bracket literal strings correctly.

Reported by Frans de Jonge <fransdejonge@gmail.com>
at <https://savannah.gnu.org/bugs/?56794>.

* gettext-tools/src/x-lua.c (phase3_get): Test for EOF first. After an opening
long bracket, swallow one newline.
* gettext-tools/tests/xgettext-lua-1: Add tests for newlines in long brackets.
* gettext-tools/tests/xgettext-lua-2: Update comment.

6 years agoxgettext: Recognize gettext -e invocations in shell parser.
Bruno Haible [Mon, 19 Aug 2019 08:52:36 +0000 (10:52 +0200)] 
xgettext: Recognize gettext -e invocations in shell parser.

Reported by Eugene V. Lyubimkin <jackyf.devel@gmail.com>
in <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507091>.

* gettext-runtime/src/escapes.h: New file, extracted from
gettext-runtime/src/gettext.c.
* gettext-runtime/src/gettext.c: Include escapes.h.
(expand_escape): Remove function.
(inhibit_added_newline): New variable.
(add_newline): Remove variable.
(main): Initialize inhibit_added_newline. Invoke expand_escapes instead of
expand_escape.
* gettext-runtime/src/ngettext.c: Include escapes.h.
(expand_escape): Remove function.
(main): Invoke expand_escapes instead of expand_escape.
* gettext-runtime/src/Makefile.am (gettext_SOURCES, ngettext_SOURCES): Add
escapes.h.
* gettext-tools/tests/tstgettext.c: Include escapes.h.
(expand_escape): Remove function.
(inhibit_added_newline): New variable.
(add_newline): Remove variable.
(main): Initialize inhibit_added_newline. Invoke expand_escapes instead of
expand_escape.
* gettext-tools/tests/Makefile.am (tstgettext_SOURCES): Add escapes.h.
* gettext-tools/src/x-sh.c: Include escapes.h.
(read_command): Recognize a '-e' option in the argument list of gettext and
ngettext.
* gettext-tools/src/Makefile.am (xgettext_SOURCES): Add escapes.h.
* gettext-tools/tests/xgettext-sh-1: Test the recognition of gettext -e
arguments.
* NEWS: Mention the change.

6 years agodoc: Fix documentation of gettext, ngettext programs.
Bruno Haible [Mon, 19 Aug 2019 08:24:30 +0000 (10:24 +0200)] 
doc: Fix documentation of gettext, ngettext programs.

* gettext-runtime/doc/rt-gettext.texi: Clarify when the additional newline is
emitted.
* gettext-runtime/doc/rt-ngettext.texi: Remove '\c' from the list of recognized
escape sequences.

6 years agoUpdate after gnulib changed.
Bruno Haible [Mon, 19 Aug 2019 02:10:38 +0000 (04:10 +0200)] 
Update after gnulib changed.

* gettext-runtime/intl/localcharset.c: Update from gnulib.
* gettext-runtime/intl/verify.h: Likewise.

6 years agogettext, ngettext: Fix the expansion of '\\' and octal escape sequences.
Bruno Haible [Mon, 19 Aug 2019 00:16:43 +0000 (02:16 +0200)] 
gettext, ngettext: Fix the expansion of '\\' and octal escape sequences.

* gettext-runtime/src/gettext.c (expand_escape): Don't swallow the expansion
of '\\' and octal escape sequences.
* gettext-runtime/src/ngettext.c (expand_escape): Likewise.
* gettext-tools/tests/tstgettext.c (expand_escape): Likewise.
* NEWS: Mention the change.

6 years agoxgettext: Fix parsing of escaped single-quote characters in shell parser.
Bruno Haible [Sun, 18 Aug 2019 23:34:34 +0000 (01:34 +0200)] 
xgettext: Fix parsing of escaped single-quote characters in shell parser.

Reported by Markus Gothe <nietzsche@lysator.liu.se>
at <https://savannah.gnu.org/bugs/?49809>.

* gettext-tools/src/x-sh.c (phase2_getc): Handle the case c == '\''
&& !open_singlequote && !open_doublequote differently.
* gettext-tools/tests/xgettext-sh-1: Add test with an escape single-quote.

6 years agoxgettext: Fix endless loop in shell parser.
Bruno Haible [Sun, 18 Aug 2019 23:02:26 +0000 (01:02 +0200)] 
xgettext: Fix endless loop in shell parser.

Reported by Hanno Boeck at <https://savannah.gnu.org/bugs/?45408>.
Based on patch by Daiki Ueno.

* gettext-tools/src/x-sh.c (read_word): React on CLOSING_BACKQUOTE even when we
are currently not looking for a closing backquote.

6 years agobuild: Don't use an obsolete libtool macro.
Bruno Haible [Sun, 18 Aug 2019 15:06:49 +0000 (17:06 +0200)] 
build: Don't use an obsolete libtool macro.

* gettext-tools/m4/exported.m4 (gt_GLOBAL_SYMBOL_PIPE): Require
_LT_CMD_GLOBAL_SYMBOLS, not AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE.

6 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 18 Aug 2019 14:15:30 +0000 (16:15 +0200)] 
Update to the newest gnulib.

6 years agolibtextstyle: Fix VPATH build (regression from yesterday).
Bruno Haible [Sun, 18 Aug 2019 14:40:51 +0000 (16:40 +0200)] 
libtextstyle: Fix VPATH build (regression from yesterday).

* libtextstyle/lib/Makefile.am (AM_CPPFLAGS): Search also the glib subdirectory
of the build dir.

6 years agoDon't extract Icon values from .desktop files into POT files.
Bruno Haible [Sun, 18 Aug 2019 11:27:30 +0000 (13:27 +0200)] 
Don't extract Icon values from .desktop files into POT files.

Reported by Piotr Drąg <piotrdrag@gmail.com>
at <https://savannah.gnu.org/support/?108887>
and by Will Thompson <wjt@endlessm.com>
at <https://savannah.gnu.org/bugs/?56543>.

There was a discussion starting at
<https://lists.freedesktop.org/archives/xdg/2019-June/014158.html>.
The most interesting posts in this thread were
<https://lists.freedesktop.org/archives/xdg/2019-June/014164.html>
<https://lists.freedesktop.org/archives/xdg/2019-June/014167.html>.

* gettext-tools/doc/gettext.texi (Icons): New subsubsection.
* gettext-tools/src/read-desktop.c (desktop_add_default_keywords): Don't add
"Icon".
* gettext-tools/src/x-desktop.c: Update comments.
* gettext-tools/doc/xgettext.texi (Desktop): Remove 'Icon' from the list of
extracted keys.
* gettext-tools/tests/xgettext-desktop-2: New file.
* gettext-tools/tests/msgfmt-desktop-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.

6 years agomaint: Document how to deal with the build error in gettext-tools/examples/po.
Bruno Haible [Sun, 18 Aug 2019 08:59:40 +0000 (10:59 +0200)] 
maint: Document how to deal with the build error in gettext-tools/examples/po.

Reported by Nick Alcock <nix@esperi.org.uk>
at <https://savannah.gnu.org/bugs/?56529>.

* HACKING (Building off the Git repository): Explain the common build error and
how to fix it.

6 years agolibtextstyle: Upgrade to libcroco-0.6.13.
Bruno Haible [Tue, 21 May 2019 01:29:55 +0000 (03:29 +0200)] 
libtextstyle: Upgrade to libcroco-0.6.13.

This fixes a couple of warnings.

Reported by Frank Hunleth <fhunleth@troodon-software.com>
at <https://savannah.gnu.org/bugs/?55356>.

* libtextstyle/gnulib-local/lib/libcroco/*: Upgrade to version 0.6.13.
* libtextstyle/gnulib-local/modules/libcroco: Update.
* libtextstyle/gnulib-local/lib/glib/gmacros.in.h: New file, based on
glib-2.12.4/glib/gmacros.h.
* libtextstyle/gnulib-local/lib/glib/gprintfint.in.h: New file, based on
glib-2.12.4/glib/gprintfint.h.
* libtextstyle/Makefile.am (EXTRA_DIST): Add them.
* libtextstyle/gnulib-local/m4/libglib.m4 (gl_LIBGLIB): Add glib/gmacros.h and
glib/gprintfint.h to LIBGLIB_H.
* libtextstyle/gnulib-local/modules/libglib (Files): Add lib/glib/gmacros.in.h,
lib/glib/gprintfint.in.h.
(Depends-on): Add snprintf-posix.
(glib/gmacros.h, glib/gprintfint.h): New rules.
(MOSTLYCLEANFILES): Add glib/gmacros.h, glib/gprintfint.h.
* libtextstyle/gnulib-local/lib/glib.in.h: Include glib/gmacros.h.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.in.h (g_ascii_dtostr,
g_ascii_formatd, g_ascii_strcasecmp): Enable declarations.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c: Include gprintfint.h.
(g_ascii_dtostr, g_ascii_formatd): Enable.
(ISSPACE, ISUPPER, ISLOWER, ISALPHA, TOUPPER, TOLOWER): Move out of function
g_parse_long_long.
(g_ascii_strcasecmp): Enable.

6 years agolibtextstyle: Document the hyperlink support.
Bruno Haible [Wed, 14 Aug 2019 18:52:35 +0000 (20:52 +0200)] 
libtextstyle: Document the hyperlink support.

* libtextstyle/doc/libtextstyle.texi (The NO_TERM_HYPERLINKS variable): New
section.
(Hyperlinks): New subsection.
(The abstract styled_ostream class): Document styled_ostream_get_hyperlink_ref,
styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink.
(The term_ostream class): Document term_ostream_get_hyperlink_ref,
term_ostream_get_hyperlink_id, term_ostream_set_hyperlink.
(The html_ostream class): Document html_ostream_get_hyperlink_ref,
html_ostream_set_hyperlink_ref.
* libtextstyle/NEWS: Mention it.

6 years agolibtextstyle: styled-ostream: Add hyperlink support.
Bruno Haible [Wed, 14 Aug 2019 18:52:30 +0000 (20:52 +0200)] 
libtextstyle: styled-ostream: Add hyperlink support.

* libtextstyle/gnulib-local/lib/styled-ostream.oo.h (struct styled_ostream): Add
methods get_hyperlink_ref, get_hyperlink_id, set_hyperlink.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.c
(term_styled_ostream::get_hyperlink_ref, term_styled_ostream::get_hyperlink_id,
term_styled_ostream::set_hyperlink): New functions.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c
(struct html_styled_ostream): Add field hyperlink_id.
(html_styled_ostream::free): Free the hyperlink_id field.
(html_styled_ostream::get_hyperlink_ref, html_styled_ostream::get_hyperlink_id,
html_styled_ostream::set_hyperlink): New functions.
(html_styled_ostream_create): Initialize the hyperlink_id field.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.c
(struct noop_styled_ostream): Add fields hyperlink_ref, hyperlink_id.
(noop_styled_ostream::free): Free the hyperlink_ref and hyperlink_id fields.
(noop_styled_ostream::get_hyperlink_ref, noop_styled_ostream::get_hyperlink_id,
noop_styled_ostream::set_hyperlink): New functions.
(noop_styled_ostream_create): Initialize the hyperlink_ref and hyperlink_id
fields.
* libtextstyle/lib/textstyle.h (styled_ostream_get_hyperlink_ref,
styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink,
term_styled_ostream_get_hyperlink_ref, term_styled_ostream_get_hyperlink_id,
term_styled_ostream_set_hyperlink, html_styled_ostream_get_hyperlink_ref,
html_styled_ostream_get_hyperlink_id, html_styled_ostream_set_hyperlink,
noop_styled_ostream_get_hyperlink_ref, noop_styled_ostream_get_hyperlink_id,
noop_styled_ostream_set_hyperlink): New declarations.
* libtextstyle/adhoc-tests/hello.c (main): Invoke styled_ostream_set_hyperlink.

6 years agolibtextstyle: html-ostream: Add hyperlink support.
Bruno Haible [Wed, 14 Aug 2019 18:52:25 +0000 (20:52 +0200)] 
libtextstyle: html-ostream: Add hyperlink support.

* libtextstyle/gnulib-local/lib/html-ostream.oo.h (struct html_ostream): Add
methods get_hyperlink_ref, set_hyperlink_ref.
* libtextstyle/gnulib-local/lib/html-ostream.oo.c (struct html_ostream): Add
field hyperlink_ref;
(write_attribute_value): New function.
(html_ostream::free): Emit an anchor end if needed.
(html_ostream::get_hyperlink_ref, html_ostream::set_hyperlink_ref): New
functions.
(html_ostream_create): Initialize the hyperlink_ref field.
* libtextstyle/lib/textstyle.h (html_ostream_get_hyperlink_ref,
html_ostream_set_hyperlink_ref): New declarations.

6 years agolibtextstyle: term-ostream: Add hyperlink support.
Bruno Haible [Wed, 14 Aug 2019 18:52:21 +0000 (20:52 +0200)] 
libtextstyle: term-ostream: Add hyperlink support.

* libtextstyle/gnulib-local/lib/term-ostream.oo.h (struct term_ostream): Add
methods get_hyperlink_ref, get_hyperlink_id, set_hyperlink.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c: Include <stdint.h>,
<sys/time.h>, get_ppid_of.h, get_progname_of.h, xgethostname.h.
(hyperlink_t): New type.
(free_hyperlink): New function.
(attributes_t): Add 'hyperlink' field.
(equal_attributes): Compare also the 'hyperlink' field.
(struct term_ostream): Add fields supports_hyperlink, restore_hyperlink,
hostname_hash, start_time, id_serial, hyperlinks_array, hyperlinks_count,
hyperlinks_allocated, active_attr_hyperlink.
(simplify_attributes): Deal with 'hyperlink' field.
(generate_hyperlink_id): New function.
(out_hyperlink_change): New function.
(out_attr_change): Set active_attr_hyperlink. Invoke out_hyperlink_change.
(restore, async_restore): Use stream->restore_hyperlink.
(async_set_attributes_from_default): Invoke out_hyperlink_change.
(output_buffer): At the end, free the unused hyperlink_t objects.
(term_ostream::free): Free the hyperlinks_array and its contents.
(term_ostream::get_hyperlink_ref, term_ostream::get_hyperlink_id,
term_ostream::set_hyperlink): New functions.
(get_terminal_emulator_progname, should_enable_hyperlinks): New functions.
(term_ostream_create): Set the fields supports_hyperlink, restore_hyperlink,
hostname_hash, start_time, id_serial, hyperlinks_array, hyperlinks_count,
hyperlinks_allocated.
* libtextstyle/gnulib-local/m4/term-ostream.m4 (gl_TERM_OSTREAM): Test for
getsid function.
* libtextstyle/gnulib-local/modules/term-ostream (Depends-on): Add gettimeofday,
get_ppid_of, get_progname_of, stdint, xgethostname.
* libtextstyle/lib/textstyle.h (term_ostream_get_hyperlink_ref,
term_ostream_get_hyperlink_id, term_ostream_set_hyperlink): New declarations.

6 years agoUpdate to the newest gnulib.
Bruno Haible [Wed, 14 Aug 2019 18:50:30 +0000 (20:50 +0200)] 
Update to the newest gnulib.

6 years agolibtextstyle: Support the NO_COLOR environment variable.
Bruno Haible [Wed, 14 Aug 2019 00:46:36 +0000 (02:46 +0200)] 
libtextstyle: Support the NO_COLOR environment variable.

It follows the specification at https://no-color.org/.

The support is in the example programs, not in the function
styled_ostream_create, so that it can be overridden through the command-line
option --color=always.

We only test whether the environment variable is set, not whether its value
is non-empty. POSIX-specified environment variables are treated like unset
when their value is empty; this is because in the old days it was not possible
to unset an environment variable. But nowadays:
  - all shells support the 'unset' built-in,
  - all platforms that have the setenv() function also have the unsetenv()
    function, and
  - the 'env' program from GNU coreutils supports --unset=VARIABLE to unset a
    variable.
This makes it possible to unset an environment variable that is set by the
parent process.

* libtextstyle/adhoc-tests/hello.c (main): Do not emit styling when the
environment variable NO_COLOR is set.
* libtextstyle/examples/color-filter/filter.c (main): Likewise.
* libtextstyle/examples/color-hello/hello.c (main): Likewise.
* gettext-tools/src/write-catalog.c (msgdomain_list_print): Likewise.
* libtextstyle/doc/libtextstyle.texi (The NO_COLOR variable): New section.
* libtextstyle/NEWS: Mention it.

6 years agoxalloc: Add x2realloc function, from gnulib.
Bruno Haible [Mon, 12 Aug 2019 01:31:49 +0000 (03:31 +0200)] 
xalloc: Add x2realloc function, from gnulib.

* gnulib-local/lib/xalloc.h (x2realloc): New declaration, from
gnulib/lib/xalloc.h.
* gnulib-local/lib/xmalloc.c (x2nrealloc): New function, from
gnulib/lib/xalloc.h.
(x2realloc): New function, from gnulib/lib/xmalloc.c.
* gnulib-local/modules/xalloc (configure.ac): Require AC_C_INLINE.