libxml2 r3785 - in trunk: . doc/examples



Author: veillard
Date: Fri Aug 29 19:58:23 2008
New Revision: 3785
URL: http://svn.gnome.org/viewvc/libxml2?rev=3785&view=rev

Log:
* 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


Modified:
   trunk/ChangeLog
   trunk/HTMLparser.c
   trunk/Makefile.am
   trunk/doc/examples/reader3.c

Modified: trunk/HTMLparser.c
==============================================================================
--- trunk/HTMLparser.c	(original)
+++ trunk/HTMLparser.c	Fri Aug 29 19:58:23 2008
@@ -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))

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Fri Aug 29 19:58:23 2008
@@ -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
 

Modified: trunk/doc/examples/reader3.c
==============================================================================
--- trunk/doc/examples/reader3.c	(original)
+++ trunk/doc/examples/reader3.c	Fri Aug 29 19:58:23 2008
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]