]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
cldr-plurals: Improve error handling.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Oct 2018 11:39:13 +0000 (13:39 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Oct 2018 21:44:05 +0000 (23:44 +0200)
* gettext-tools/src/cldr-plurals.c (extract_rules): Let libxml2 show errors.
Don't assume that the error was an out-of-memory.

gettext-tools/src/cldr-plurals.c

index e2278511c50c85c5c0ed0127e67bdbf22c7c0aa5..10c469ac0d09c23ad323ba936dbf370b5df03ff4 100644 (file)
@@ -55,10 +55,9 @@ extract_rules (FILE *fp,
   doc = xmlReadFd (fileno (fp), logical_filename, NULL,
                    XML_PARSE_NONET
                    | XML_PARSE_NOWARNING
-                   | XML_PARSE_NOERROR
                    | XML_PARSE_NOBLANKS);
   if (doc == NULL)
-    error (EXIT_FAILURE, 0, _("memory exhausted"));
+    error (EXIT_FAILURE, 0, _("Could not parse file %s as XML"), logical_filename);
 
   node = xmlDocGetRootElement (doc);
   if (!node || !xmlStrEqual (node->name, BAD_CAST "supplementalData"))