CRUX PPC
A lightweight GNU/Linux distribution for PowerPC!
Subversion Repository
Parent Directory
|
Revision Log
Revision 2604 -
(show annotations)
Wed Feb 1 22:16:42 2012 UTC (15 months, 2 weeks ago) by gesp
File size: 1973 byte(s)
Wed Feb 1 22:16:42 2012 UTC (15 months, 2 weeks ago) by gesp
File size: 1973 byte(s)
libxml2: fixed to 2.7.8-2
| 1 | From 77404b8b69bc122d12231807abf1a837d121b551 Mon Sep 17 00:00:00 2001 |
| 2 | From: Chris Evans <scarybeasts@gmail.com> |
| 3 | Date: Wed, 14 Dec 2011 08:18:25 +0000 |
| 4 | Subject: Make sure the parser returns when getting a Stop order |
| 5 | |
| 6 | patch backported from chromiun bug fixes, assuming author is Chris |
| 7 | --- |
| 8 | diff --git a/parser.c b/parser.c |
| 9 | index 21d7aa3..4e5dcb9 100644 |
| 10 | --- a/parser.c |
| 11 | +++ b/parser.c |
| 12 | @@ -4949,7 +4949,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { |
| 13 | (ctxt->sax->processingInstruction != NULL)) |
| 14 | ctxt->sax->processingInstruction(ctxt->userData, |
| 15 | target, NULL); |
| 16 | - ctxt->instate = state; |
| 17 | + if (ctxt->instate != XML_PARSER_EOF) |
| 18 | + ctxt->instate = state; |
| 19 | return; |
| 20 | } |
| 21 | buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); |
| 22 | @@ -5029,7 +5030,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { |
| 23 | } else { |
| 24 | xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); |
| 25 | } |
| 26 | - ctxt->instate = state; |
| 27 | + if (ctxt->instate != XML_PARSER_EOF) |
| 28 | + ctxt->instate = state; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | @@ -9589,6 +9591,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { |
| 33 | else |
| 34 | name = xmlParseStartTag(ctxt); |
| 35 | #endif /* LIBXML_SAX1_ENABLED */ |
| 36 | + if (ctxt->instate == XML_PARSER_EOF) |
| 37 | + return; |
| 38 | if (name == NULL) { |
| 39 | spacePop(ctxt); |
| 40 | return; |
| 41 | @@ -10975,6 +10979,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { |
| 42 | else |
| 43 | name = xmlParseStartTag(ctxt); |
| 44 | #endif /* LIBXML_SAX1_ENABLED */ |
| 45 | + if (ctxt->instate == XML_PARSER_EOF) |
| 46 | + goto done; |
| 47 | if (name == NULL) { |
| 48 | spacePop(ctxt); |
| 49 | ctxt->instate = XML_PARSER_EOF; |
| 50 | @@ -11161,7 +11167,9 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { |
| 51 | else |
| 52 | xmlParseEndTag1(ctxt, 0); |
| 53 | #endif /* LIBXML_SAX1_ENABLED */ |
| 54 | - if (ctxt->nameNr == 0) { |
| 55 | + if (ctxt->instate == XML_PARSER_EOF) { |
| 56 | + /* Nothing */ |
| 57 | + } else if (ctxt->nameNr == 0) { |
| 58 | ctxt->instate = XML_PARSER_EPILOG; |
| 59 | } else { |
| 60 | ctxt->instate = XML_PARSER_CONTENT; |
| 61 | -- |
| 62 | cgit v0.9.0.2 |