]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libgettextpo: Remove static variable error_with_progname.
authorBruno Haible <bruno@clisp.org>
Wed, 7 Aug 2024 17:19:26 +0000 (19:19 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 7 Aug 2024 17:35:38 +0000 (19:35 +0200)
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.

autogen.sh
gettext-tools/src/read-po-lex.c
gettext-tools/src/read-properties.c
gettext-tools/src/read-stringtable.c
gettext-tools/src/write-catalog.c

index e4d6d906506e763f4c906e92138e6aec2d3bb49f..b1c71d00dcb59d9be68ca29709c11b979abcbb9e 100755 (executable)
@@ -360,7 +360,6 @@ if ! $skip_gnulib; then
     c-strcase
     c-strstr
     error
-    error-progname
     filename
     fopen
     free-posix
index 6a6c3cb961963095da89d51f3fffc09342dc5fd9..8172b72476c9144e9e574262a74c569b892df027 100644 (file)
@@ -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"
index 543c1c658cdad905f830dc51e190a745d161dc23..2ae12fae0380b19166a6e41e554b71ece580fd75 100644 (file)
@@ -30,7 +30,6 @@
 #include <string.h>
 
 #include <error.h>
-#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;
                 }
index 018e7a1317b7145f05784cbd995a3a5ebd439aec..986ec02972aef18accf5e7d71faf6158d0eaced0 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <error.h>
 #include "attribute.h"
-#include "error-progname.h"
 #include "read-catalog-abstract.h"
 #include "xalloc.h"
 #include "xvasprintf.h"
index b17f6a3e5045cc13acdbe86d80cefeed41396c68..b0a7451f5a57dc7e7fa183490f624c57e41154d3 100644 (file)
@@ -36,7 +36,6 @@
 #include <textstyle.h>
 
 #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;
             }
         }
     }