fixed problem with UTF8 pattern separator (bug 151975)
authorWilliam M. Brack <wbrack@src.gnome.org>
Tue, 7 Sep 2004 07:14:42 +0000 (07:14 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Tue, 7 Sep 2004 07:14:42 +0000 (07:14 +0000)
* libxslt/numbers.c: fixed problem with UTF8 pattern
  separator (bug 151975)

ChangeLog
libxslt/numbers.c

index c9bd062..5cf705a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep  7 00:14:12 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/numbers.c: fixed problem with UTF8 pattern
+         separator (bug 151975)
+
 Mon Sep  6 14:27:38 PDT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/imports.c, libxslt/xslt.c, libxslt/xsltInternals.h:
index 6382bcd..1660793 100644 (file)
@@ -1182,8 +1182,15 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
            default_sign = 1;
        }
        else {
+            int lenPS;
+           lenPS = xmlUTF8Size(self->patternSeparator);
+           if (lenPS <= 0) {
+               found_error = 1;
+               goto OUTPUT_NUMBER;
+           }
+       
            /* Skip over pattern separator */
-           the_format = format + j + 1;
+           the_format = format + j + lenPS;
            /* 
             * Flag changes interpretation of percent/permille 
             * in -ve pattern