[xslt] [PATCH] Bug #62577




Re,

The attached patch should fix bug #62577
<http://bugzilla.gnome.org/show_bug.cgi?id=62577>

At least it works with the provided test case. Needs some more testing...

Tom.
Index: libxslt/numbers.c
===================================================================
RCS file: /cvs/gnome/libxslt/libxslt/numbers.c,v
retrieving revision 1.30
diff -u -r1.30 numbers.c
--- libxslt/numbers.c	2001/10/17 01:08:23	1.30
+++ libxslt/numbers.c	2001/10/25 19:46:50
@@ -833,16 +833,26 @@
     /* flag to show error found, should use default format */
     char	found_error = 0;
 
+    *result = NULL;
     switch (xmlXPathIsInf(number)) {
 	case -1:
-	    *result = xmlStrdup(BAD_CAST "-Infinity");
-	    return(status);
+	    if (self->minusSign == NULL)
+		*result = xmlStrdup(BAD_CAST "-");
+	    else
+		*result = xmlStrdup(self->minusSign);
+	    /* no-break on purpose */
 	case 1:
-	    *result = xmlStrdup(BAD_CAST "Infinity");
+	    if ((self == NULL) || (self->infinity == NULL))
+		*result = xmlStrcat(*result, BAD_CAST "Infinity");
+	    else
+		*result = xmlStrcat(*result, self->infinity);
 	    return(status);
 	default:
 	    if (xmlXPathIsNaN(number)) {
-		*result = xmlStrdup(BAD_CAST "NaN");
+		if ((self == NULL) || (self->noNumber == NULL))
+		    *result = xmlStrdup(BAD_CAST "NaN");
+		else
+		    *result = xmlStrdup(self->noNumber);
 		return(status);
 	    }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]