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>
|
Thu Mar 27 15:53:35 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: fixing #109227 providing more context in case of
|
* parser.c: fixing #109227 providing more context in case of
|
||||||
|
@ -2631,9 +2631,9 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
|
|||||||
} else if (CUR == '\'') {
|
} else if (CUR == '\'') {
|
||||||
NEXT;
|
NEXT;
|
||||||
q = CUR_PTR;
|
q = CUR_PTR;
|
||||||
while ((IS_LETTER(CUR)) && (CUR != '\''))
|
while ((IS_PUBIDCHAR(CUR)) && (CUR != '\''))
|
||||||
NEXT;
|
NEXT;
|
||||||
if (!IS_LETTER(CUR)) {
|
if (CUR != '\'') {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
|
ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
|
2
tree.c
2
tree.c
@ -2970,8 +2970,8 @@ xmlFreeNodeList(xmlNodePtr cur) {
|
|||||||
if ((cur->type == XML_DOCUMENT_NODE) ||
|
if ((cur->type == XML_DOCUMENT_NODE) ||
|
||||||
#ifdef LIBXML_DOCB_ENABLED
|
#ifdef LIBXML_DOCB_ENABLED
|
||||||
(cur->type == XML_DOCB_DOCUMENT_NODE) ||
|
(cur->type == XML_DOCB_DOCUMENT_NODE) ||
|
||||||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
|
||||||
#endif
|
#endif
|
||||||
|
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
||||||
xmlFreeDoc((xmlDocPtr) cur);
|
xmlFreeDoc((xmlDocPtr) cur);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -223,105 +223,106 @@ xmlSchemaInitBasicType(const char *name, xmlSchemaValType type) {
|
|||||||
* Initialize the default XML Schemas type library
|
* Initialize the default XML Schemas type library
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xmlSchemaInitTypes(void) {
|
xmlSchemaInitTypes(void)
|
||||||
|
{
|
||||||
if (xmlSchemaTypesInitialized != 0)
|
if (xmlSchemaTypesInitialized != 0)
|
||||||
return;
|
return;
|
||||||
xmlSchemaTypesBank = xmlHashCreate(40);
|
xmlSchemaTypesBank = xmlHashCreate(40);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* primitive datatypes
|
* primitive datatypes
|
||||||
*/
|
*/
|
||||||
xmlSchemaTypeStringDef = xmlSchemaInitBasicType("string",
|
xmlSchemaTypeStringDef = xmlSchemaInitBasicType("string",
|
||||||
XML_SCHEMAS_STRING);
|
XML_SCHEMAS_STRING);
|
||||||
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType",
|
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType",
|
||||||
XML_SCHEMAS_UNKNOWN);
|
XML_SCHEMAS_UNKNOWN);
|
||||||
xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType",
|
xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType",
|
||||||
XML_SCHEMAS_UNKNOWN);
|
XML_SCHEMAS_UNKNOWN);
|
||||||
xmlSchemaTypeDecimalDef = xmlSchemaInitBasicType("decimal",
|
xmlSchemaTypeDecimalDef = xmlSchemaInitBasicType("decimal",
|
||||||
XML_SCHEMAS_DECIMAL);
|
XML_SCHEMAS_DECIMAL);
|
||||||
xmlSchemaTypeDateDef = xmlSchemaInitBasicType("date",
|
xmlSchemaTypeDateDef = xmlSchemaInitBasicType("date",
|
||||||
XML_SCHEMAS_DATE);
|
XML_SCHEMAS_DATE);
|
||||||
xmlSchemaTypeDatetimeDef = xmlSchemaInitBasicType("dateTime",
|
xmlSchemaTypeDatetimeDef = xmlSchemaInitBasicType("dateTime",
|
||||||
XML_SCHEMAS_DATETIME);
|
XML_SCHEMAS_DATETIME);
|
||||||
xmlSchemaTypeTimeDef = xmlSchemaInitBasicType("time",
|
xmlSchemaTypeTimeDef = xmlSchemaInitBasicType("time",
|
||||||
XML_SCHEMAS_TIME);
|
XML_SCHEMAS_TIME);
|
||||||
xmlSchemaTypeGYearDef = xmlSchemaInitBasicType("gYear",
|
xmlSchemaTypeGYearDef = xmlSchemaInitBasicType("gYear",
|
||||||
XML_SCHEMAS_GYEAR);
|
XML_SCHEMAS_GYEAR);
|
||||||
xmlSchemaTypeGYearMonthDef = xmlSchemaInitBasicType("gYearMonth",
|
xmlSchemaTypeGYearMonthDef = xmlSchemaInitBasicType("gYearMonth",
|
||||||
XML_SCHEMAS_GYEARMONTH);
|
XML_SCHEMAS_GYEARMONTH);
|
||||||
xmlSchemaTypeGMonthDef = xmlSchemaInitBasicType("gMonth",
|
xmlSchemaTypeGMonthDef = xmlSchemaInitBasicType("gMonth",
|
||||||
XML_SCHEMAS_GMONTH);
|
XML_SCHEMAS_GMONTH);
|
||||||
xmlSchemaTypeGMonthDayDef = xmlSchemaInitBasicType("gMonthDay",
|
xmlSchemaTypeGMonthDayDef = xmlSchemaInitBasicType("gMonthDay",
|
||||||
XML_SCHEMAS_GMONTHDAY);
|
XML_SCHEMAS_GMONTHDAY);
|
||||||
xmlSchemaTypeGDayDef = xmlSchemaInitBasicType("gDay",
|
xmlSchemaTypeGDayDef = xmlSchemaInitBasicType("gDay",
|
||||||
XML_SCHEMAS_GDAY);
|
XML_SCHEMAS_GDAY);
|
||||||
xmlSchemaTypeDurationDef = xmlSchemaInitBasicType("duration",
|
xmlSchemaTypeDurationDef = xmlSchemaInitBasicType("duration",
|
||||||
XML_SCHEMAS_DURATION);
|
XML_SCHEMAS_DURATION);
|
||||||
xmlSchemaTypeFloatDef = xmlSchemaInitBasicType("float",
|
xmlSchemaTypeFloatDef = xmlSchemaInitBasicType("float",
|
||||||
XML_SCHEMAS_FLOAT);
|
XML_SCHEMAS_FLOAT);
|
||||||
xmlSchemaTypeDoubleDef = xmlSchemaInitBasicType("double",
|
xmlSchemaTypeDoubleDef = xmlSchemaInitBasicType("double",
|
||||||
XML_SCHEMAS_DOUBLE);
|
XML_SCHEMAS_DOUBLE);
|
||||||
xmlSchemaTypeBooleanDef = xmlSchemaInitBasicType("boolean",
|
xmlSchemaTypeBooleanDef = xmlSchemaInitBasicType("boolean",
|
||||||
XML_SCHEMAS_BOOLEAN);
|
XML_SCHEMAS_BOOLEAN);
|
||||||
xmlSchemaTypeAnyURIDef = xmlSchemaInitBasicType("anyURI",
|
xmlSchemaTypeAnyURIDef = xmlSchemaInitBasicType("anyURI",
|
||||||
XML_SCHEMAS_ANYURI);
|
XML_SCHEMAS_ANYURI);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* derived datatypes
|
* derived datatypes
|
||||||
*/
|
*/
|
||||||
xmlSchemaTypeIntegerDef = xmlSchemaInitBasicType("integer",
|
xmlSchemaTypeIntegerDef = xmlSchemaInitBasicType("integer",
|
||||||
XML_SCHEMAS_INTEGER);;
|
XML_SCHEMAS_INTEGER);;
|
||||||
xmlSchemaTypeNonPositiveIntegerDef = xmlSchemaInitBasicType("nonPositiveInteger",
|
xmlSchemaTypeNonPositiveIntegerDef =
|
||||||
XML_SCHEMAS_NPINTEGER);;
|
xmlSchemaInitBasicType("nonPositiveInteger",
|
||||||
xmlSchemaTypeNegativeIntegerDef = xmlSchemaInitBasicType("negativeInteger",
|
XML_SCHEMAS_NPINTEGER);;
|
||||||
XML_SCHEMAS_NINTEGER);;
|
xmlSchemaTypeNegativeIntegerDef =
|
||||||
xmlSchemaTypeLongDef = xmlSchemaInitBasicType("long",
|
xmlSchemaInitBasicType("negativeInteger", XML_SCHEMAS_NINTEGER);;
|
||||||
XML_SCHEMAS_LONG);;
|
xmlSchemaTypeLongDef =
|
||||||
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int",
|
xmlSchemaInitBasicType("long", XML_SCHEMAS_LONG);;
|
||||||
XML_SCHEMAS_INT);;
|
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int", XML_SCHEMAS_INT);;
|
||||||
xmlSchemaTypeShortDef = xmlSchemaInitBasicType("short",
|
xmlSchemaTypeShortDef = xmlSchemaInitBasicType("short",
|
||||||
XML_SCHEMAS_SHORT);;
|
XML_SCHEMAS_SHORT);;
|
||||||
xmlSchemaTypeByteDef = xmlSchemaInitBasicType("byte",
|
xmlSchemaTypeByteDef = xmlSchemaInitBasicType("byte",
|
||||||
XML_SCHEMAS_BYTE);;
|
XML_SCHEMAS_BYTE);;
|
||||||
xmlSchemaTypeNonNegativeIntegerDef = xmlSchemaInitBasicType("nonNegativeInteger",
|
xmlSchemaTypeNonNegativeIntegerDef =
|
||||||
XML_SCHEMAS_NNINTEGER);
|
xmlSchemaInitBasicType("nonNegativeInteger",
|
||||||
xmlSchemaTypeUnsignedLongDef = xmlSchemaInitBasicType("unsignedLong",
|
XML_SCHEMAS_NNINTEGER);
|
||||||
XML_SCHEMAS_ULONG);;
|
xmlSchemaTypeUnsignedLongDef =
|
||||||
xmlSchemaTypeUnsignedIntDef = xmlSchemaInitBasicType("unsignedInt",
|
xmlSchemaInitBasicType("unsignedLong", XML_SCHEMAS_ULONG);;
|
||||||
XML_SCHEMAS_UINT);;
|
xmlSchemaTypeUnsignedIntDef =
|
||||||
xmlSchemaTypeUnsignedShortDef = xmlSchemaInitBasicType("insignedShort",
|
xmlSchemaInitBasicType("unsignedInt", XML_SCHEMAS_UINT);;
|
||||||
XML_SCHEMAS_USHORT);;
|
xmlSchemaTypeUnsignedShortDef =
|
||||||
xmlSchemaTypeUnsignedByteDef = xmlSchemaInitBasicType("unsignedByte",
|
xmlSchemaInitBasicType("insignedShort", XML_SCHEMAS_USHORT);;
|
||||||
XML_SCHEMAS_UBYTE);;
|
xmlSchemaTypeUnsignedByteDef =
|
||||||
xmlSchemaTypePositiveIntegerDef = xmlSchemaInitBasicType("positiveInteger",
|
xmlSchemaInitBasicType("unsignedByte", XML_SCHEMAS_UBYTE);;
|
||||||
XML_SCHEMAS_PINTEGER);
|
xmlSchemaTypePositiveIntegerDef =
|
||||||
|
xmlSchemaInitBasicType("positiveInteger", XML_SCHEMAS_PINTEGER);
|
||||||
|
|
||||||
xmlSchemaTypeNormStringDef = xmlSchemaInitBasicType("normalizedString",
|
xmlSchemaTypeNormStringDef = xmlSchemaInitBasicType("normalizedString",
|
||||||
XML_SCHEMAS_NORMSTRING);
|
XML_SCHEMAS_NORMSTRING);
|
||||||
xmlSchemaTypeTokenDef = xmlSchemaInitBasicType("token",
|
xmlSchemaTypeTokenDef = xmlSchemaInitBasicType("token",
|
||||||
XML_SCHEMAS_TOKEN);
|
XML_SCHEMAS_TOKEN);
|
||||||
xmlSchemaTypeLanguageDef = xmlSchemaInitBasicType("language",
|
xmlSchemaTypeLanguageDef = xmlSchemaInitBasicType("language",
|
||||||
XML_SCHEMAS_LANGUAGE);
|
XML_SCHEMAS_LANGUAGE);
|
||||||
xmlSchemaTypeIdDef = xmlSchemaInitBasicType("ID",
|
xmlSchemaTypeIdDef = xmlSchemaInitBasicType("ID", XML_SCHEMAS_ID);
|
||||||
XML_SCHEMAS_ID);
|
|
||||||
xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF",
|
xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF",
|
||||||
XML_SCHEMAS_IDREF);
|
XML_SCHEMAS_IDREF);
|
||||||
xmlSchemaTypeIdrefsDef = xmlSchemaInitBasicType("IDREFS",
|
xmlSchemaTypeIdrefsDef = xmlSchemaInitBasicType("IDREFS",
|
||||||
XML_SCHEMAS_IDREFS);
|
XML_SCHEMAS_IDREFS);
|
||||||
xmlSchemaTypeEntityDef = xmlSchemaInitBasicType("ENTITY",
|
xmlSchemaTypeEntityDef = xmlSchemaInitBasicType("ENTITY",
|
||||||
XML_SCHEMAS_ENTITY);
|
XML_SCHEMAS_ENTITY);
|
||||||
xmlSchemaTypeEntitiesDef = xmlSchemaInitBasicType("ENTITIES",
|
xmlSchemaTypeEntitiesDef = xmlSchemaInitBasicType("ENTITIES",
|
||||||
XML_SCHEMAS_ENTITIES);
|
XML_SCHEMAS_ENTITIES);
|
||||||
xmlSchemaTypeNameDef = xmlSchemaInitBasicType("Name",
|
xmlSchemaTypeNameDef = xmlSchemaInitBasicType("Name",
|
||||||
XML_SCHEMAS_NAME);
|
XML_SCHEMAS_NAME);
|
||||||
xmlSchemaTypeQNameDef = xmlSchemaInitBasicType("QName",
|
xmlSchemaTypeQNameDef = xmlSchemaInitBasicType("QName",
|
||||||
XML_SCHEMAS_QNAME);
|
XML_SCHEMAS_QNAME);
|
||||||
xmlSchemaTypeNCNameDef = xmlSchemaInitBasicType("NCName",
|
xmlSchemaTypeNCNameDef = xmlSchemaInitBasicType("NCName",
|
||||||
XML_SCHEMAS_NCNAME);
|
XML_SCHEMAS_NCNAME);
|
||||||
xmlSchemaTypeNmtokenDef = xmlSchemaInitBasicType("NMTOKEN",
|
xmlSchemaTypeNmtokenDef = xmlSchemaInitBasicType("NMTOKEN",
|
||||||
XML_SCHEMAS_NMTOKEN);
|
XML_SCHEMAS_NMTOKEN);
|
||||||
xmlSchemaTypeNmtokensDef = xmlSchemaInitBasicType("NMTOKENS",
|
xmlSchemaTypeNmtokensDef = xmlSchemaInitBasicType("NMTOKENS",
|
||||||
XML_SCHEMAS_NMTOKENS);
|
XML_SCHEMAS_NMTOKENS);
|
||||||
xmlSchemaTypesInitialized = 1;
|
xmlSchemaTypesInitialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2141,18 +2142,24 @@ xmlSchemaCompareDates (xmlSchemaValPtr x, xmlSchemaValPtr y)
|
|||||||
p2 = xmlSchemaDateNormalize(x, (14 * SECS_PER_HOUR));
|
p2 = xmlSchemaDateNormalize(x, (14 * SECS_PER_HOUR));
|
||||||
p2d = _xmlSchemaDateCastYMToDays(p2) + p2->value.date.day;
|
p2d = _xmlSchemaDateCastYMToDays(p2) + p2->value.date.day;
|
||||||
|
|
||||||
xmlSchemaFreeValue(p1);
|
if (p2d > q1d) {
|
||||||
xmlSchemaFreeValue(q1);
|
xmlSchemaFreeValue(p1);
|
||||||
xmlSchemaFreeValue(p2);
|
xmlSchemaFreeValue(q1);
|
||||||
if (p2d > q1d)
|
xmlSchemaFreeValue(p2);
|
||||||
return 1;
|
return 1;
|
||||||
else if (p2d == q1d) {
|
} else if (p2d == q1d) {
|
||||||
sec = TIME_TO_NUMBER(p2) - TIME_TO_NUMBER(q1);
|
sec = TIME_TO_NUMBER(p2) - TIME_TO_NUMBER(q1);
|
||||||
|
xmlSchemaFreeValue(p1);
|
||||||
|
xmlSchemaFreeValue(q1);
|
||||||
|
xmlSchemaFreeValue(p2);
|
||||||
if (sec > 0.0)
|
if (sec > 0.0)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 2; /* indeterminate */
|
return 2; /* indeterminate */
|
||||||
}
|
}
|
||||||
|
xmlSchemaFreeValue(p1);
|
||||||
|
xmlSchemaFreeValue(q1);
|
||||||
|
xmlSchemaFreeValue(p2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
xmlSchemaFreeValue(p1);
|
xmlSchemaFreeValue(p1);
|
||||||
|
Reference in New Issue
Block a user