diff options
author | Christopher Gilbert <christopher.john.gilbert@gmail.com> | 2016-08-30 19:29:37 +0800 |
---|---|---|
committer | Christopher Gilbert <christopher.john.gilbert@gmail.com> | 2016-08-30 19:29:37 +0800 |
commit | 1b9147d7db08a94dd00532bc611ac322c8ed3e57 (patch) | |
tree | 80b4c89b5c0b7aed52e994d43d6d471ed926fa72 /solc | |
parent | 29b8965b9541e75905bb688954649ee7b0b0fefc (diff) | |
download | dexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.tar.gz dexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.tar.zst dexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.zip |
Fixed a bug causing solc to crash on startup due to invalid environment settings for locale
Diffstat (limited to 'solc')
-rw-r--r-- | solc/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 <clocale> #include <iostream> #include <boost/exception/all.hpp> 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; |