diff --git a/src/fixes.cpp b/src/fixes.cpp
index 72498c4481681da85b136652213015203b06f2d6..4aed2c3130916aaedc03afd40c2b67b1aae86ce4 100644 (file)
--- a/src/fixes.cpp
+++ b/src/fixes.cpp
* $Id$
*
* 2004 Kees Cook
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# include "config.h"
#endif
-#if defined(g_ascii_strtod)
+//#if defined(g_ascii_strtod)
+#if 0
/*
* until 2004-04-22, g_ascii_strtod could not handle having a locale-based
* decimal separator immediately following the number ("5,4" would
decimal_point_len = strlen (decimal_point);
g_assert (decimal_point_len != 0);
-
+
decimal_point_pos = NULL;
- if (decimal_point[0] != '.' ||
+ if (decimal_point[0] != '.' ||
decimal_point[1] != 0)
{
p = nptr;
/* Skip leading space */
while (g_ascii_isspace (*p))
p++;
-
+
/* Skip leading optional sign */
if (*p == '+' || *p == '-')
p++;
-
- if (p[0] == '0' &&
+
+ if (p[0] == '0' &&
(p[1] == 'x' || p[1] == 'X'))
{
p += 2;
/* HEX - find the (optional) decimal point */
-
+
while (g_ascii_isxdigit (*p))
p++;
-
+
if (*p == '.')
{
decimal_point_pos = p++;
-
+
while (g_ascii_isxdigit (*p))
p++;
-
+
if (*p == 'p' || *p == 'P')
p++;
if (*p == '+' || *p == '-')
{
while (g_ascii_isdigit (*p))
p++;
-
+
if (*p == '.')
{
decimal_point_pos = p++;
-
+
while (g_ascii_isdigit (*p))
p++;
-
+
if (*p == 'e' || *p == 'E')
p++;
if (*p == '+' || *p == '-')
/* Set errno to zero, so that we can distinguish zero results
and underflows */
errno = 0;
-
+
if (decimal_point_pos)
{
char *copy, *c;
/* We need to convert the '.' to the locale specific decimal point */
copy = (char*)g_malloc (end - nptr + 1 + decimal_point_len);
-
+
c = copy;
memcpy (c, nptr, decimal_point_pos - nptr);
c += decimal_point_pos - nptr;
else
fail_pos = (char *)nptr + (fail_pos - copy);
}
-
+
g_free (copy);
-
+
}
else if (decimal_point[0] != '.' ||
decimal_point[1] != 0)
{
char *copy;
-
+
copy = (char*)g_malloc (end - (char *)nptr + 1);
memcpy (copy, nptr, end - nptr);
*(copy + (end - (char *)nptr)) = 0;
-
+
val = strtod (copy, &fail_pos);
-
+
if (fail_pos)
{
fail_pos = (char *)nptr + (fail_pos - copy);
}
-
+
g_free (copy);
}
else
if (endptr)
*endptr = fail_pos;
-
+
return val;
}
}