mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-15 07:16:13 -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 <clocale>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
@ -82,6 +83,9 @@ int safe_main(std::function<int(void)> fn) {
|
||||
#ifndef _WIN32
|
||||
folly::symbolizer::installFatalSignalHandler();
|
||||
#endif
|
||||
auto loc = std::getenv("LC_ALL");
|
||||
std::setlocale(LC_ALL, loc ? loc : "");
|
||||
|
||||
return fn();
|
||||
} catch (system_error const& e) {
|
||||
std::cerr << "ERROR: " << folly::exceptionStr(e) << " [" << e.file() << ":"
|
||||
|
Loading…
x
Reference in New Issue
Block a user