1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 05:59:16 +00:00

Fix possible crash on OSX introduced with localisation patch

This commit is contained in:
fgenesis 2012-05-27 16:56:36 +02:00
parent c02ea1ce83
commit 99e3f5ebe2

View file

@ -614,12 +614,17 @@ void UserSettings::getSystemLocale()
}
}
#else
system.locale = getenv("LANG");
// FIXME: Apparently this is not set when starting the game via the UI on OSX.
const char *lang = (const char *)getenv("LANG");
if (lang && *lang)
{
system.locale = lang;
size_t found = system.locale.find('.');
size_t found = system.locale.find('.');
if (found != string::npos)
system.locale.resize(found);
if (found != string::npos)
system.locale.resize(found);
}
#endif
if (system.locale.empty())
debugLog("could not establish system locale");