Add a testcase for the previous fix.

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)
This commit is contained in:
Matthias Clasen 2004-11-26 04:40:41 +00:00 committed by Matthias Clasen
parent 43fde23cee
commit 6b69bf8866
7 changed files with 37 additions and 1 deletions

View 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.

View 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.

View 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.

View 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.

View 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.

View 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++;

View 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));