mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
handle null from std::locale::locale (fixes #88)
This commit is contained in:
@@ -898,11 +898,15 @@ int main(int argc, char **argv) {
|
||||
|
||||
char *systemLocale = std::setlocale(LC_ALL, "");
|
||||
try {
|
||||
std::locale::global(std::locale(systemLocale));
|
||||
if (systemLocale != nullptr) {
|
||||
std::locale::global(std::locale(systemLocale));
|
||||
}
|
||||
} catch (...) {
|
||||
try {
|
||||
std::locale::global(std::locale::classic());
|
||||
std::setlocale(LC_ALL, systemLocale);
|
||||
if (systemLocale != nullptr) {
|
||||
std::setlocale(LC_ALL, systemLocale);
|
||||
}
|
||||
} catch (...) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user