patch from Robert Schwebel , allows to compile the example if configured

* doc/examples/reader3.c: patch from  Robert Schwebel , allows to
  compile the example if configured without output support fixes
  #545582
* Makefile.am: add testrecurse to the make check tests
* HTMLparser.c: if the parser got a encoding argument it should be
  used over what the meta specifies, patch fixing #536346
Daniel

svn path=/trunk/; revision=3785
diff --git a/ChangeLog b/ChangeLog
index 756b8c5..2fe8f68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,17 @@
+Fri Aug 29 21:53:12 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+	* doc/examples/reader3.c: patch from  Robert Schwebel , allows to
+	  compile the example if configured without output support fixes
+	  #545582
+	* Makefile.am: add testrecurse to the make check tests
+	* HTMLparser.c: if the parser got a encoding argument it should be
+	  used over what the meta specifies, patch fixing #536346
+
 Fri Aug 29 14:41:38 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
 	* parser.c: a couple more fixes
-	* nanohttp.c nanoftp.c: patch from Andreas Färber  to compile on Haiku
+	* nanohttp.c nanoftp.c: patch from Andreas Färber to compile on Haiku
+	  fixes #527880
 	* doc/examples/*: regenerated
 
 Thu Aug 28 17:31:46 CEST 2008 Daniel Veillard <daniel@veillard.com>
diff --git a/HTMLparser.c b/HTMLparser.c
index a16faf6..57e64df 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -5973,8 +5973,12 @@
         xmlCharEncodingHandlerPtr hdlr;
 
 	hdlr = xmlFindCharEncodingHandler(encoding);
-	if (hdlr != NULL)
+	if (hdlr != NULL) {
 	    xmlSwitchToEncoding(ctxt, hdlr);
+	    if (ctxt->input->encoding != NULL)
+	      xmlFree((xmlChar *) ctxt->input->encoding);
+            ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
+        }
     }
     if ((URL != NULL) && (ctxt->input != NULL) &&
         (ctxt->input->filename == NULL))
diff --git a/Makefile.am b/Makefile.am
index cc21bf9..de57c46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -177,7 +177,7 @@
 #testOOM_LDADD= $(LDADDS)
 
 runtests:
-	$(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
+	$(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
 
 check: all runtests
 
diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c
index acbff4f..51f9d3b 100644
--- a/doc/examples/reader3.c
+++ b/doc/examples/reader3.c
@@ -15,7 +15,8 @@
 #include <stdio.h>
 #include <libxml/xmlreader.h>
 
-#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
+#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+
 
 /**
  * streamFile:
@@ -113,7 +114,7 @@
 
 #else
 int main(void) {
-    fprintf(stderr, "Reader or Pattern support not compiled in\n");
+    fprintf(stderr, "Reader, Pattern or output support not compiled in\n");
     exit(1);
 }
 #endif