mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-17 00:10:03 -04:00
Call setlocale(LC_ALL) to make sure libarchive works correctly
This commit is contained in:
parent
f671976526
commit
af1877b7f6
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
#include <clocale>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -82,6 +83,9 @@ int safe_main(std::function<int(void)> fn) {
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
folly::symbolizer::installFatalSignalHandler();
|
folly::symbolizer::installFatalSignalHandler();
|
||||||
#endif
|
#endif
|
||||||
|
auto loc = std::getenv("LC_ALL");
|
||||||
|
std::setlocale(LC_ALL, loc ? loc : "");
|
||||||
|
|
||||||
return fn();
|
return fn();
|
||||||
} catch (system_error const& e) {
|
} catch (system_error const& e) {
|
||||||
std::cerr << "ERROR: " << folly::exceptionStr(e) << " [" << e.file() << ":"
|
std::cerr << "ERROR: " << folly::exceptionStr(e) << " [" << e.file() << ":"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user