8187772: JVM crash when currency set on MacOS 10.10 and earlier

Reviewed-by: naoto
This commit is contained in:
Brent Christian 2017-10-16 11:20:59 -07:00
parent 5c7381d739
commit e8c680e65b

View File

@ -113,6 +113,12 @@ char *getMacOSXLocale(int cat) {
}
if (retVal != NULL) {
// convertToPOSIXLocale() does not expect any variant codes, so ignore
// '@' and anything following, if present.
char* rmAt = strchr(retVal, '@');
if (rmAt != NULL) {
*rmAt = '\0';
}
return strdup(convertToPOSIXLocale(retVal));
}