raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=7e02c59a43b2a8492e2cf8695c000075aa8f127e

commit 7e02c59a43b2a8492e2cf8695c000075aa8f127e
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Apr 12 10:59:31 2021 +0100

    e startup - nuke some code that eina takes care of
    
    eina has eina_convert_strtod_c() which ignores locale... so use that
    instead of a workaround.
---
 src/bin/e_startup.c | 31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/src/bin/e_startup.c b/src/bin/e_startup.c
index 0286375e2..e1d44177c 100644
--- a/src/bin/e_startup.c
+++ b/src/bin/e_startup.c
@@ -54,30 +54,6 @@ _e_startup_delay(void *data)
    return EINA_FALSE;
 }
 
-// custom float parser for N.nnnn, or N,nnnn or N to avoid locale issues
-static double
-_atof(const char *s)
-{
-   const char *p;
-   double v = 0, dec;
-
-   for (p = s; isdigit(*p); p++)
-     {
-        v *= 10.0;
-        v += (double)(*p - '0');
-     }
-   if ((*p == '.') || (*p == ','))
-     {
-        dec = 0.1;
-        for (p++; isdigit(*p); p++)
-          {
-             v += ((double)(*p - '0')) * dec;
-             dec /= 10.0;
-          }
-     }
-   return v;
-}
-
 static void
 _e_startup(void)
 {
@@ -103,12 +79,7 @@ _e_startup(void)
    if (desktop->x)
      {
         s = eina_hash_find(desktop->x, "X-GNOME-Autostart-Delay");
-        if (s)
-          {
-             const char *prev = setlocale(LC_NUMERIC, "C");
-             delay = _atof(s);
-             setlocale(LC_NUMERIC, prev);
-          }
+        if (s) delay = eina_convert_strtod_c(s, NULL);
      }
    if (delay > 0.0)
      {

-- 


Reply via email to