From 1b9147d7db08a94dd00532bc611ac322c8ed3e57 Mon Sep 17 00:00:00 2001 From: Christopher Gilbert Date: Tue, 30 Aug 2016 12:29:37 +0100 Subject: Fixed a bug causing solc to crash on startup due to invalid environment settings for locale --- solc/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'solc') diff --git a/solc/main.cpp b/solc/main.cpp index eaada1c4..bc8bdc81 100644 --- a/solc/main.cpp +++ b/solc/main.cpp @@ -21,13 +21,24 @@ */ #include "CommandLineInterface.h" +#include #include #include using namespace std; +void setEnv() { + std::setlocale(LC_ALL, "C"); +#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + if (!std::setlocale(LC_ALL, "")) { + setenv("LC_ALL", "C", 1); + } +#endif +} + int main(int argc, char** argv) { + setEnv(); dev::solidity::CommandLineInterface cli; if (!cli.parseArguments(argc, argv)) return 1; -- cgit