From dc01b60d5c861e91605484222ce364fe8c2c28c0 Mon Sep 17 00:00:00 2001
From: Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Date: Fri, 28 Sep 2018 12:12:18 +0200
Subject: [PATCH] Force the locale LC_ALL to be POSIX (in Hurricane::DataBase).

* Problem: In LEF/DEF, the parsers makes use of the libc "strtod()" which
    is now localized. So, if your environment is set up for French, the
    decimal separator is not '.' (dot) but ',' (comma). So floating
    numbers in LEF/DEF file are not longer recognized as such, causing
    the parsers to fail with a LEFPARS-1 error.
      To avoid that, we force the LC_ALL environment variable to POSIX
    in Hurricane::DataBase::create(). So first things that happens when
    Hurricane starts, is the environment to be reset.
      Strangely, when I try to setup only LC_NUMERIC with setlocale()
    it doesn't work. There is something I'm missing there...
---
 hurricane/src/hurricane/DataBase.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hurricane/src/hurricane/DataBase.cpp b/hurricane/src/hurricane/DataBase.cpp
index 60005397..686c3eff 100644
--- a/hurricane/src/hurricane/DataBase.cpp
+++ b/hurricane/src/hurricane/DataBase.cpp
@@ -17,6 +17,7 @@
 // not, see <http://www.gnu.org/licenses/>.
 // ****************************************************************************************************
 
+#include <cstdlib>
 #include "hurricane/Initializer.h"
 #include "hurricane/Warning.h"
 #include "hurricane/Error.h"
@@ -127,6 +128,8 @@ DataBase::DataBase()
 DataBase* DataBase::create()
 // *************************
 {
+    setenv( "LC_ALL", "POSIX", 1 );
+
     DataBase* dataBase = new DataBase();
 
     dataBase->_postCreate();