From 6634dd8346ffc21011565176f09fa447400f1d94 Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Sat, 20 Dec 2003 09:29:59 +0000 Subject: [PATCH] fixed several routines to assure empty string returned (rather than a * libexslt/date.c: fixed several routines to assure empty string returned (rather than a string object with a null string pointer) (Bug 129561) --- ChangeLog | 6 ++++++ libexslt/date.c | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d9ee75..6659218 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Dec 20 16:22:11 HKT 2003 William Brack + + * libexslt/date.c: fixed several routines to assure empty + string returned (rather than a string object with a null + string pointer) (Bug 129561) + Mon Dec 16 00:30:47 PST 2003 William Brack * doc/Makefile.am doc/site.xsl doc/api.xsl doc/newapi.xsl diff --git a/libexslt/date.c b/libexslt/date.c index b7b71dd..9853e0b 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -2879,7 +2879,10 @@ exsltDateDateTimeFunction (xmlXPathParserContextPtr ctxt, int nargs) } ret = exsltDateDateTime(); - xmlXPathReturnString(ctxt, ret); + if (ret == NULL) + xmlXPathReturnEmptyString(ctxt); + else + xmlXPathReturnString(ctxt, ret); } #endif @@ -3351,7 +3354,10 @@ exsltDateAddFunction (xmlXPathParserContextPtr ctxt, int nargs) { xmlFree(ystr); xmlFree(xstr); - xmlXPathReturnString(ctxt, ret); + if (ret == NULL) + xmlXPathReturnEmptyString(ctxt); + else + xmlXPathReturnString(ctxt, ret); } /** @@ -3384,7 +3390,10 @@ exsltDateAddDurationFunction (xmlXPathParserContextPtr ctxt, int nargs) { xmlFree(ystr); xmlFree(xstr); - xmlXPathReturnString(ctxt, ret); + if (ret == NULL) + xmlXPathReturnEmptyString(ctxt); + else + xmlXPathReturnString(ctxt, ret); } /** @@ -3417,7 +3426,10 @@ exsltDateDifferenceFunction (xmlXPathParserContextPtr ctxt, int nargs) { xmlFree(ystr); xmlFree(xstr); - xmlXPathReturnString(ctxt, ret); + if (ret == NULL) + xmlXPathReturnEmptyString(ctxt); + else + xmlXPathReturnString(ctxt, ret); } /** -- 2.7.4