]> git.ipfire.org Git - thirdparty/gettext.git/commit
its: Improve libxml error handling. master
authorBruno Haible <bruno@clisp.org>
Wed, 13 Aug 2025 20:19:19 +0000 (22:19 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 13 Aug 2025 20:20:46 +0000 (22:20 +0200)
commitce283b4b85d36a9a7b472aafedd6b6b447f1072d
tree4b97390dd01c6658a4f116dcf436c0a57d691630
parent6836b4362407d9f1958044102c3806904a1ba29b
its: Improve libxml error handling.

When there is a non-fatal error, the previous code would just print a message
to stderr and continue the operation, without affecting the exit code.

* gettext-tools/src/its.c: Include <setjmp.h>, <stdarg.h>.
(xml_error_exit): New variable.
(structured_error): Longjmp to xml_error_exit.
(generic_error): New function.
(its_rule_list_add_from_file, its_rule_list_add_from_string,
its_rule_list_extract, its_merge_context_merge, its_merge_context_alloc,
its_merge_context_write): Invoke also xmlSetGenericErrorFunc. Use setjmp to
abort the operation when a non-fatal error occurs.
gettext-tools/src/its.c