From 118c7572cc590a5400f10c69df41c9d847f8aebd Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Fri, 24 Sep 2004 16:15:16 +0000 Subject: [PATCH] fixed problem with empty sets, etc. (see discussion on mailing list) * libexslt/date.c: fixed problem with empty sets, etc. (see discussion on mailing list) --- ChangeLog | 5 +++++ libexslt/date.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6d5e07..abb28ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 24 09:17:22 PDT 2004 William Brack + + * libexslt/date.c: fixed problem with empty sets, etc. + (see discussion on mailing list) + Sat Sep 18 17:08:31 PDT 2004 William Brack * libexslt/date.c: fixed problem with timezone offset diff --git a/libexslt/date.c b/libexslt/date.c index 3cf8160..0d3445c 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -2748,20 +2748,28 @@ exsltDateSumFunction (xmlXPathParserContextPtr ctxt, int nargs) 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; } -- 2.7.4