]> git.ipfire.org Git - thirdparty/gettext.git/commit
intl: Fix translation lookup failure when wbindtextdomain is used.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Jun 2023 08:49:04 +0000 (10:49 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Jun 2023 10:58:50 +0000 (12:58 +0200)
commit40df836f7474dec73a1cd89e80977692d7f42dcb
tree1f4ea6088e2a247ffcbc4000a87abe3850ec0b50
parent71c263334d8cff012ecc2803519183b5e06e6ed9
intl: Fix translation lookup failure when wbindtextdomain is used.

Reported by Luca Bacci <luca.bacci@outlook.com> at
<https://savannah.gnu.org/bugs/index.php?64311>.

The bug showed up when a call to bindtextdomain() with an absolute directory
and a call to wbindtextdomain() for a different domain was in effect.
Translations in the first referenced domain worked, translations in the second
referenced domain did not.

* gettext-runtime/intl/loadinfo.h (struct loaded_l10nfile, _nl_make_l10nflist):
Improve comments.
* gettext-runtime/intl/finddomain.c (_nl_loaded_domains): Likewise.
* gettext-runtime/intl/l10nflist.c (_nl_make_l10nflist): Fix code that looks up
the loaded_l10nfile in the given list, and make it more maintainable.
* gettext-tools/tests/intl-6: Improve comments.
* gettext-tools/tests/intl-6-prg.c (main): Restructure.
* gettext-tools/tests/intl-7: New file, based on gettext-tools/tests/intl-6.
* gettext-tools/tests/intl-6-prg.c: New file, based on
gettext-tools/tests/intl-6-prg.c.
* gettext-tools/tests/Makefile.am (TESTS): Add intl-7.
(check_PROGRAMS): Add intl-7-prg.
(intl_7_prg_SOURCES, intl_7_prg_LDADD): New variables.
.gitignore
gettext-runtime/intl/finddomain.c
gettext-runtime/intl/l10nflist.c
gettext-runtime/intl/loadinfo.h
gettext-tools/tests/Makefile.am
gettext-tools/tests/intl-6
gettext-tools/tests/intl-6-prg.c
gettext-tools/tests/intl-7 [new file with mode: 0755]
gettext-tools/tests/intl-7-prg.c [new file with mode: 0644]