mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03: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, "");
|
char *systemLocale = std::setlocale(LC_ALL, "");
|
||||||
try {
|
try {
|
||||||
std::locale::global(std::locale(systemLocale));
|
if (systemLocale != nullptr) {
|
||||||
|
std::locale::global(std::locale(systemLocale));
|
||||||
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
try {
|
try {
|
||||||
std::locale::global(std::locale::classic());
|
std::locale::global(std::locale::classic());
|
||||||
std::setlocale(LC_ALL, systemLocale);
|
if (systemLocale != nullptr) {
|
||||||
|
std::setlocale(LC_ALL, systemLocale);
|
||||||
|
}
|
||||||
} catch (...) {}
|
} catch (...) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user