- HTMLparser.c: fixed loop reported by Marc Sanfacon
Daniel
diff --git a/HTMLparser.c b/HTMLparser.c
index 9dffd58..a83b669 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -3322,8 +3322,8 @@
 	    return;
 	}
 
-	if ((xmlStrEqual(currentNode, BAD_CAST"script")) ||
-	    (xmlStrEqual(currentNode, BAD_CAST"style"))) {
+	if ((CUR != 0) && ((xmlStrEqual(currentNode, BAD_CAST"script")) ||
+	    (xmlStrEqual(currentNode, BAD_CAST"style")))) {
 	    /*
 	     * Handle SCRIPT/STYLE separately
 	     */
@@ -3371,7 +3371,10 @@
 	     * Fourth : end of the resource
 	     */
 	    else if (CUR == 0) {
+		int level = ctxt->nodeNr;
 		htmlAutoClose(ctxt, NULL);
+		if (level == ctxt->nodeNr)
+		    break;
 	    }
 
 	    /*