* libexslt/date.c: fixed problem with empty sets, etc.
(see discussion on mailing list)
+Fri Sep 24 09:17:22 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * libexslt/date.c: fixed problem with empty sets, etc.
+ (see discussion on mailing list)
+
Sat Sep 18 17:08:31 PDT 2004 William Brack <wbrack@mmm.com.hk>
* libexslt/date.c: fixed problem with timezone offset
if (xmlXPathCheckError (ctxt))
return;
- if ((ns == NULL) || (ns->nodeNr == 0))
+ if ((ns == NULL) || (ns->nodeNr == 0)) {
+ xmlXPathReturnEmptyString (ctxt);
return;
+ }
total = exsltDateCreateDate (XS_DURATION);
+ if (total == NULL)
+ return;
for (i = 0; i < ns->nodeNr; i++) {
tmp = xmlXPathCastNodeToString (ns->nodeTab[i]);
- if (tmp == NULL)
+ if (tmp == NULL) {
+ exsltDateFreeDate (total);
return;
+ }
x = exsltDateParseDuration (tmp);
if (x == NULL) {
xmlFree (tmp);
+ exsltDateFreeDate (total);
+ xmlXPathReturnEmptyString (ctxt);
return;
}