Add a testcase for the previous fix.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 26 Nov 2004 04:40:41 +0000 (04:40 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 26 Nov 2004 04:40:41 +0000 (04:40 +0000)
2004-11-25  Matthias Clasen  <mclasen@redhat.com>

* tests/strtod-test.c (main): Add a testcase for the previous fix.

* glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
starting with a decimal point, like .75  (#156421, Hans Breuer)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gstrfuncs.c
tests/strtod-test.c

index 106f5fb..81aea56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/strtod-test.c (main): Add a testcase for the previous fix.
+
+       * glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
+       starting with a decimal point, like .75  (#156421, Hans Breuer)
+
 Thu Nov 25 14:02:43 2004  Manish Singh  <yosh@gimp.org>
 
        * glib/abicheck.sh: filter out G_GNUC stuff when doing the compare.
index 106f5fb..81aea56 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/strtod-test.c (main): Add a testcase for the previous fix.
+
+       * glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
+       starting with a decimal point, like .75  (#156421, Hans Breuer)
+
 Thu Nov 25 14:02:43 2004  Manish Singh  <yosh@gimp.org>
 
        * glib/abicheck.sh: filter out G_GNUC stuff when doing the compare.
index 106f5fb..81aea56 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/strtod-test.c (main): Add a testcase for the previous fix.
+
+       * glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
+       starting with a decimal point, like .75  (#156421, Hans Breuer)
+
 Thu Nov 25 14:02:43 2004  Manish Singh  <yosh@gimp.org>
 
        * glib/abicheck.sh: filter out G_GNUC stuff when doing the compare.
index 106f5fb..81aea56 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/strtod-test.c (main): Add a testcase for the previous fix.
+
+       * glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
+       starting with a decimal point, like .75  (#156421, Hans Breuer)
+
 Thu Nov 25 14:02:43 2004  Manish Singh  <yosh@gimp.org>
 
        * glib/abicheck.sh: filter out G_GNUC stuff when doing the compare.
index 106f5fb..81aea56 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/strtod-test.c (main): Add a testcase for the previous fix.
+
+       * glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
+       starting with a decimal point, like .75  (#156421, Hans Breuer)
+
 Thu Nov 25 14:02:43 2004  Manish Singh  <yosh@gimp.org>
 
        * glib/abicheck.sh: filter out G_GNUC stuff when doing the compare.
index afb0223..89a5008 100644 (file)
@@ -386,7 +386,7 @@ g_ascii_strtod (const gchar *nptr,
 
          end = p;
        }
-      else if (g_ascii_isdigit (*p))
+      else if (g_ascii_isdigit (*p) || *p == '.')
        {
          while (g_ascii_isdigit (*p))
            p++;
index 3eab6ea..a5a4a23 100644 (file)
@@ -95,6 +95,7 @@ main ()
   test_string ("-nan", -our_nan, FALSE, 0);
   test_string ("INF", our_inf, FALSE, 0);
   test_string ("-infinity", -our_inf, FALSE, 0);
+  test_string ("-.75,0", -0.75, TRUE, 4);
   
   d = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0;
   g_assert (d == g_ascii_strtod (g_ascii_dtostr (buffer, sizeof (buffer), d), NULL));