make sure xmlCtxtReadFile and htmlCtxtReadFile go through the catalog

* HTMLparser.c parser.c: make sure xmlCtxtReadFile and htmlCtxtReadFile
  go through the catalog resolution.
* gentest.py testapi.c: fix a side effect wrning of the change
Daniel
diff --git a/ChangeLog b/ChangeLog
index c04b8d8..0ad1743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Nov 26 11:44:36 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+	* HTMLparser.c parser.c: make sure xmlCtxtReadFile and htmlCtxtReadFile
+	  go through the catalog resolution.
+	* gentest.py testapi.c: fix a side effect wrning of the change
+
 Wed Nov 24 13:41:52 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 	* dict.c include/libxml/dict.h: added xmlDictExists() to the 
diff --git a/HTMLparser.c b/HTMLparser.c
index 4f84d7c..b87b01f 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -6038,7 +6038,7 @@
 
     htmlCtxtReset(ctxt);
 
-    stream = xmlNewInputFromFile(ctxt, filename);
+    stream = xmlLoadExternalEntity(filename, NULL, ctxt);
     if (stream == NULL) {
         return (NULL);
     }
diff --git a/gentest.py b/gentest.py
index b789133..fb37eda 100755
--- a/gentest.py
+++ b/gentest.py
@@ -165,7 +165,7 @@
    "xmlCatalogRemove", "xmlLoadCatalogs", "xmlCleanupCharEncodingHandlers",
    "xmlInitCharEncodingHandlers", "xmlCatalogCleanup",
    "xmlSchemaGetBuiltInType",
-   "htmlParseFile", # loads the catalogs
+   "htmlParseFile", "htmlCtxtReadFile" # loads the catalogs
 ]
 
 #
diff --git a/parser.c b/parser.c
index baa9c47..654d72a 100644
--- a/parser.c
+++ b/parser.c
@@ -12732,7 +12732,7 @@
 
     xmlCtxtReset(ctxt);
 
-    stream = xmlNewInputFromFile(ctxt, filename);
+    stream = xmlLoadExternalEntity(filename, NULL, ctxt);
     if (stream == NULL) {
         return (NULL);
     }
diff --git a/testapi.c b/testapi.c
index c5773ae..1f17680 100644
--- a/testapi.c
+++ b/testapi.c
@@ -1537,7 +1537,6 @@
     int test_ret = 0;
 
 #ifdef LIBXML_HTML_ENABLED
-    int mem_base;
     htmlDocPtr ret_val;
     htmlParserCtxtPtr ctxt; /* an HTML parser context */
     int n_ctxt;
@@ -1552,7 +1551,6 @@
     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
     for (n_options = 0;n_options < gen_nb_int;n_options++) {
-        mem_base = xmlMemBlocks();
         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
         filename = gen_filepath(n_filename, 1);
         encoding = gen_const_char_ptr(n_encoding, 2);
@@ -1566,16 +1564,6 @@
         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
         des_int(n_options, options, 3);
         xmlResetLastError();
-        if (mem_base != xmlMemBlocks()) {
-            printf("Leak of %d blocks found in htmlCtxtReadFile",
-	           xmlMemBlocks() - mem_base);
-	    test_ret++;
-            printf(" %d", n_ctxt);
-            printf(" %d", n_filename);
-            printf(" %d", n_encoding);
-            printf(" %d", n_options);
-            printf("\n");
-        }
     }
     }
     }