From: Bruno Haible Date: Wed, 7 Aug 2024 17:19:26 +0000 (+0200) Subject: libgettextpo: Remove static variable error_with_progname. X-Git-Tag: v0.23~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bd6c8f7029d5d1962def24db0e620d50b8e97be;p=thirdparty%2Fgettext.git libgettextpo: Remove static variable error_with_progname. Inside libgettextpo, assignments to error_with_progname are undesired. Outside libgettextpo, they are redundant. * gettext-tools/src/read-po-lex.c: Don't include error-progname.h. * gettext-tools/src/read-properties.c: Don't include error-progname.h. (read_escaped_string): Remove assignments to error_with_progname. * gettext-tools/src/read-stringtable.c: Don't include error-progname.h. * gettext-tools/src/write-catalog.c: Don't include error-progname.h. (msgdomain_list_print): Remove assignments to error_with_progname. * autogen.sh (GNULIB_MODULES_LIBGETTEXTPO): Remove error-progname. --- diff --git a/autogen.sh b/autogen.sh index e4d6d9065..b1c71d00d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -360,7 +360,6 @@ if ! $skip_gnulib; then c-strcase c-strstr error - error-progname filename fopen free-posix diff --git a/gettext-tools/src/read-po-lex.c b/gettext-tools/src/read-po-lex.c index 6a6c3cb96..8172b7247 100644 --- a/gettext-tools/src/read-po-lex.c +++ b/gettext-tools/src/read-po-lex.c @@ -43,7 +43,6 @@ #include "gettext.h" #include "po-charset.h" #include "xalloc.h" -#include "error-progname.h" #include "xvasprintf.h" #include "po-error.h" #include "xerror-handler.h" diff --git a/gettext-tools/src/read-properties.c b/gettext-tools/src/read-properties.c index 543c1c658..2ae12fae0 100644 --- a/gettext-tools/src/read-properties.c +++ b/gettext-tools/src/read-properties.c @@ -30,7 +30,6 @@ #include #include -#include "error-progname.h" #include "message.h" #include "read-catalog-abstract.h" #include "xalloc.h" @@ -419,12 +418,10 @@ read_escaped_string (abstract_catalog_reader_ty *catr, bool in_key) #define utf8_buffer_append_lone_surrogate(uc, line) \ do \ { \ - error_with_progname = false; \ catr->xeh->xerror (CAT_SEVERITY_ERROR, NULL, \ real_file_name, (line), (size_t)(-1), false, \ xasprintf (_("warning: lone surrogate U+%04X"), \ (uc))); \ - error_with_progname = true; \ utf8_buffer_ensure_available (3); \ utf8_buffer[utf8_buflen++] = 0xef; \ utf8_buffer[utf8_buflen++] = 0xbf; \ @@ -489,14 +486,10 @@ read_escaped_string (abstract_catalog_reader_ty *catr, bool in_key) utf8_buffer_ensure_available (6); len = u8_uctomb (utf8_buffer + utf8_buflen, uc, 6); if (len < 0) - { - error_with_progname = false; - catr->xeh->xerror (CAT_SEVERITY_ERROR, NULL, - real_file_name, pos.line_number, (size_t)(-1), - false, - _("warning: invalid Unicode character")); - error_with_progname = true; - } + catr->xeh->xerror (CAT_SEVERITY_ERROR, NULL, + real_file_name, pos.line_number, (size_t)(-1), + false, + _("warning: invalid Unicode character")); else utf8_buflen += len; @@ -525,14 +518,10 @@ read_escaped_string (abstract_catalog_reader_ty *catr, bool in_key) utf8_buffer_ensure_available (3); len = u8_uctomb (utf8_buffer + utf8_buflen, uc, 3); if (len < 0) - { - error_with_progname = false; - catr->xeh->xerror (CAT_SEVERITY_ERROR, NULL, - real_file_name, pos.line_number, (size_t)(-1), - false, - _("warning: invalid Unicode character")); - error_with_progname = true; - } + catr->xeh->xerror (CAT_SEVERITY_ERROR, NULL, + real_file_name, pos.line_number, (size_t)(-1), + false, + _("warning: invalid Unicode character")); else utf8_buflen += len; } diff --git a/gettext-tools/src/read-stringtable.c b/gettext-tools/src/read-stringtable.c index 018e7a131..986ec0297 100644 --- a/gettext-tools/src/read-stringtable.c +++ b/gettext-tools/src/read-stringtable.c @@ -31,7 +31,6 @@ #include #include "attribute.h" -#include "error-progname.h" #include "read-catalog-abstract.h" #include "xalloc.h" #include "xvasprintf.h" diff --git a/gettext-tools/src/write-catalog.c b/gettext-tools/src/write-catalog.c index b17f6a3e5..b0a7451f5 100644 --- a/gettext-tools/src/write-catalog.c +++ b/gettext-tools/src/write-catalog.c @@ -36,7 +36,6 @@ #include #include "fwriteerror.h" -#include "error-progname.h" #include "xvasprintf.h" #include "xerror-handler.h" #include "gettext.h" @@ -153,14 +152,10 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename, } if (has_context != NULL) - { - error_with_progname = false; - xeh->xerror (CAT_SEVERITY_FATAL_ERROR, NULL, - has_context->file_name, has_context->line_number, - (size_t)(-1), false, - _("message catalog has context dependent translations, but the output format does not support them.")); - error_with_progname = true; - } + xeh->xerror (CAT_SEVERITY_FATAL_ERROR, NULL, + has_context->file_name, has_context->line_number, + (size_t)(-1), false, + _("message catalog has context dependent translations, but the output format does not support them.")); } if (!output_syntax->supports_plurals) @@ -188,7 +183,6 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename, if (has_plural != NULL) { - error_with_progname = false; if (output_syntax->alternative_is_java_class) xeh->xerror (CAT_SEVERITY_FATAL_ERROR, NULL, has_plural->file_name, has_plural->line_number, @@ -199,7 +193,6 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename, has_plural->file_name, has_plural->line_number, (size_t)(-1), false, _("message catalog has plural form translations, but the output format does not support them.")); - error_with_progname = true; } } }