mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
two patches from James Bursa on the HTML parser and a typo reindenting,
* HTMLparser.c tree.c: two patches from James Bursa on the HTML parser and a typo * xmlschemastypes.c: reindenting, fixing a memory access problem with dates. Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
Thu Mar 27 22:23:07 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* HTMLparser.c tree.c: two patches from James Bursa on the HTML
|
||||
parser and a typo
|
||||
* xmlschemastypes.c: reindenting, fixing a memory access
|
||||
problem with dates.
|
||||
|
||||
Thu Mar 27 15:53:35 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c: fixing #109227 providing more context in case of
|
||||
|
@ -2631,9 +2631,9 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
|
||||
} else if (CUR == '\'') {
|
||||
NEXT;
|
||||
q = CUR_PTR;
|
||||
while ((IS_LETTER(CUR)) && (CUR != '\''))
|
||||
while ((IS_PUBIDCHAR(CUR)) && (CUR != '\''))
|
||||
NEXT;
|
||||
if (!IS_LETTER(CUR)) {
|
||||
if (CUR != '\'') {
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
|
||||
ctxt->wellFormed = 0;
|
||||
|
2
tree.c
2
tree.c
@ -2970,8 +2970,8 @@ xmlFreeNodeList(xmlNodePtr cur) {
|
||||
if ((cur->type == XML_DOCUMENT_NODE) ||
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
(cur->type == XML_DOCB_DOCUMENT_NODE) ||
|
||||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
||||
#endif
|
||||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
||||
xmlFreeDoc((xmlDocPtr) cur);
|
||||
return;
|
||||
}
|
||||
|
@ -223,7 +223,8 @@ xmlSchemaInitBasicType(const char *name, xmlSchemaValType type) {
|
||||
* Initialize the default XML Schemas type library
|
||||
*/
|
||||
void
|
||||
xmlSchemaInitTypes(void) {
|
||||
xmlSchemaInitTypes(void)
|
||||
{
|
||||
if (xmlSchemaTypesInitialized != 0)
|
||||
return;
|
||||
xmlSchemaTypesBank = xmlHashCreate(40);
|
||||
@ -271,30 +272,31 @@ xmlSchemaInitTypes(void) {
|
||||
*/
|
||||
xmlSchemaTypeIntegerDef = xmlSchemaInitBasicType("integer",
|
||||
XML_SCHEMAS_INTEGER);;
|
||||
xmlSchemaTypeNonPositiveIntegerDef = xmlSchemaInitBasicType("nonPositiveInteger",
|
||||
xmlSchemaTypeNonPositiveIntegerDef =
|
||||
xmlSchemaInitBasicType("nonPositiveInteger",
|
||||
XML_SCHEMAS_NPINTEGER);;
|
||||
xmlSchemaTypeNegativeIntegerDef = xmlSchemaInitBasicType("negativeInteger",
|
||||
XML_SCHEMAS_NINTEGER);;
|
||||
xmlSchemaTypeLongDef = xmlSchemaInitBasicType("long",
|
||||
XML_SCHEMAS_LONG);;
|
||||
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int",
|
||||
XML_SCHEMAS_INT);;
|
||||
xmlSchemaTypeNegativeIntegerDef =
|
||||
xmlSchemaInitBasicType("negativeInteger", XML_SCHEMAS_NINTEGER);;
|
||||
xmlSchemaTypeLongDef =
|
||||
xmlSchemaInitBasicType("long", XML_SCHEMAS_LONG);;
|
||||
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int", XML_SCHEMAS_INT);;
|
||||
xmlSchemaTypeShortDef = xmlSchemaInitBasicType("short",
|
||||
XML_SCHEMAS_SHORT);;
|
||||
xmlSchemaTypeByteDef = xmlSchemaInitBasicType("byte",
|
||||
XML_SCHEMAS_BYTE);;
|
||||
xmlSchemaTypeNonNegativeIntegerDef = xmlSchemaInitBasicType("nonNegativeInteger",
|
||||
xmlSchemaTypeNonNegativeIntegerDef =
|
||||
xmlSchemaInitBasicType("nonNegativeInteger",
|
||||
XML_SCHEMAS_NNINTEGER);
|
||||
xmlSchemaTypeUnsignedLongDef = xmlSchemaInitBasicType("unsignedLong",
|
||||
XML_SCHEMAS_ULONG);;
|
||||
xmlSchemaTypeUnsignedIntDef = xmlSchemaInitBasicType("unsignedInt",
|
||||
XML_SCHEMAS_UINT);;
|
||||
xmlSchemaTypeUnsignedShortDef = xmlSchemaInitBasicType("insignedShort",
|
||||
XML_SCHEMAS_USHORT);;
|
||||
xmlSchemaTypeUnsignedByteDef = xmlSchemaInitBasicType("unsignedByte",
|
||||
XML_SCHEMAS_UBYTE);;
|
||||
xmlSchemaTypePositiveIntegerDef = xmlSchemaInitBasicType("positiveInteger",
|
||||
XML_SCHEMAS_PINTEGER);
|
||||
xmlSchemaTypeUnsignedLongDef =
|
||||
xmlSchemaInitBasicType("unsignedLong", XML_SCHEMAS_ULONG);;
|
||||
xmlSchemaTypeUnsignedIntDef =
|
||||
xmlSchemaInitBasicType("unsignedInt", XML_SCHEMAS_UINT);;
|
||||
xmlSchemaTypeUnsignedShortDef =
|
||||
xmlSchemaInitBasicType("insignedShort", XML_SCHEMAS_USHORT);;
|
||||
xmlSchemaTypeUnsignedByteDef =
|
||||
xmlSchemaInitBasicType("unsignedByte", XML_SCHEMAS_UBYTE);;
|
||||
xmlSchemaTypePositiveIntegerDef =
|
||||
xmlSchemaInitBasicType("positiveInteger", XML_SCHEMAS_PINTEGER);
|
||||
|
||||
xmlSchemaTypeNormStringDef = xmlSchemaInitBasicType("normalizedString",
|
||||
XML_SCHEMAS_NORMSTRING);
|
||||
@ -302,8 +304,7 @@ xmlSchemaInitTypes(void) {
|
||||
XML_SCHEMAS_TOKEN);
|
||||
xmlSchemaTypeLanguageDef = xmlSchemaInitBasicType("language",
|
||||
XML_SCHEMAS_LANGUAGE);
|
||||
xmlSchemaTypeIdDef = xmlSchemaInitBasicType("ID",
|
||||
XML_SCHEMAS_ID);
|
||||
xmlSchemaTypeIdDef = xmlSchemaInitBasicType("ID", XML_SCHEMAS_ID);
|
||||
xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF",
|
||||
XML_SCHEMAS_IDREF);
|
||||
xmlSchemaTypeIdrefsDef = xmlSchemaInitBasicType("IDREFS",
|
||||
@ -2141,18 +2142,24 @@ xmlSchemaCompareDates (xmlSchemaValPtr x, xmlSchemaValPtr y)
|
||||
p2 = xmlSchemaDateNormalize(x, (14 * SECS_PER_HOUR));
|
||||
p2d = _xmlSchemaDateCastYMToDays(p2) + p2->value.date.day;
|
||||
|
||||
if (p2d > q1d) {
|
||||
xmlSchemaFreeValue(p1);
|
||||
xmlSchemaFreeValue(q1);
|
||||
xmlSchemaFreeValue(p2);
|
||||
if (p2d > q1d)
|
||||
return 1;
|
||||
else if (p2d == q1d) {
|
||||
} else if (p2d == q1d) {
|
||||
sec = TIME_TO_NUMBER(p2) - TIME_TO_NUMBER(q1);
|
||||
xmlSchemaFreeValue(p1);
|
||||
xmlSchemaFreeValue(q1);
|
||||
xmlSchemaFreeValue(p2);
|
||||
if (sec > 0.0)
|
||||
return 1;
|
||||
else
|
||||
return 2; /* indeterminate */
|
||||
}
|
||||
xmlSchemaFreeValue(p1);
|
||||
xmlSchemaFreeValue(q1);
|
||||
xmlSchemaFreeValue(p2);
|
||||
}
|
||||
} else {
|
||||
xmlSchemaFreeValue(p1);
|
||||
|
Reference in New Issue
Block a user