diff --git a/ChangeLog b/ChangeLog index 17ff210d..2dc6baf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jan 16 01:04:18 CET 2005 Daniel Veillard + + * xmlschemastypes.c: trying to fix at least the message from + bug #158628 + * include/libxml/xmlsave.h xmlsave.c: added first xmlsave option + for format, c.f. bug #159997 + Sat Jan 15 18:44:30 CET 2005 Daniel Veillard * python/libxml.py: make __str__ call serialize() on nodes, c.f. diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h index be5971dd..534fefdd 100644 --- a/include/libxml/xmlsave.h +++ b/include/libxml/xmlsave.h @@ -20,6 +20,17 @@ extern "C" { #endif +/** + * xmlSaveOption: + * + * This is the set of XML save options that can be passed down + * to the xmlSaveToFd() and similar calls. + */ +typedef enum { + XML_SAVE_FORMAT = 1<<0 /* format save output */ +} xmlSaveOption; + + typedef struct _xmlSaveCtxt xmlSaveCtxt; typedef xmlSaveCtxt *xmlSaveCtxtPtr; diff --git a/xmlsave.c b/xmlsave.c index 72ad6994..a774bc83 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -377,7 +377,14 @@ xmlNewSaveCtxt(const char *encoding, int options) return ( NULL ); } memset(ret, 0, sizeof(xmlSaveCtxt)); + + /* + * Use the options + */ ret->options = options; + if (options & XML_SAVE_FORMAT) + ret->format = 1; + if (encoding != NULL) { ret->handler = xmlFindCharEncodingHandler(encoding); if (ret->handler == NULL) { diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 4d9be107..622f683e 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -1656,6 +1656,9 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value, if (val == NULL) { return(-1); } + if (ret != NULL) { + *ret = NULL; + } cur = val; /* * Split the list @@ -1673,9 +1676,6 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value, } } if (nb_values == 0) { - if (ret != NULL) { - TODO - } xmlFree(val); return(nb_values); } @@ -1689,10 +1689,11 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value, while (*cur != 0) cur++; while ((*cur == 0) && (cur != endval)) cur++; } - xmlFree(val); + /* TODO what return value ? c.f. bug #158628 if (ret != NULL) { TODO - } + } */ + xmlFree(val); if (tmp == 0) return(nb_values); return(-1);