]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't kill the entire program after 20 errors.
authorBruno Haible <bruno@clisp.org>
Mon, 19 Sep 2005 16:02:59 +0000 (16:02 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:50 +0000 (12:12 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/gettext-po.c

index 0a00cbfd83e20679c6d82940ced9dbe71adbec79..49346bad757f65cab421432bcf7b0baff1ab58dd 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-16  Bruno Haible  <bruno@clisp.org>
+
+       * gettext-po.c (po_file_read): Set gram_max_allowed_errors to a large
+       integer, so that po_gram_error doesn't cause the program to exit().
+
 2005-09-14  Bruno Haible  <bruno@clisp.org>
 
        * x-csharp.c: Include xerror.h.
index 2e5e7a7fac597b181e5ac46992ccf221a44b3794..90099a33f4e096fb7758648d0d166c4a80790510 100644 (file)
@@ -23,6 +23,7 @@
 /* Specification.  */
 #include "gettext-po.h"
 
+#include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -110,6 +111,7 @@ po_file_read (const char *filename, po_error_handler_t handler)
   po_error_at_line     = handler->error_at_line;
   po_multiline_warning = handler->multiline_warning;
   po_multiline_error   = handler->multiline_error;
+  gram_max_allowed_errors = UINT_MAX;
 
   file = (struct po_file *) xmalloc (sizeof (struct po_file));
   file->real_filename = filename;
@@ -122,6 +124,7 @@ po_file_read (const char *filename, po_error_handler_t handler)
   po_error_at_line     = error_at_line;
   po_multiline_warning = multiline_warning;
   po_multiline_error   = multiline_error;
+  gram_max_allowed_errors = 20;
 
   if (fp != stdin)
     fclose (fp);