changeset 47462:33ac30e17843

8187772: JVM crash when currency set on MacOS 10.10 and earlier Reviewed-by: naoto
author bchristi
date Mon, 16 Oct 2017 11:20:59 -0700
parents fff3970bd14f
children a6d4932d582e
files src/java.base/macosx/native/libjava/java_props_macosx.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c	Mon Oct 16 18:27:07 2017 +0200
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c	Mon Oct 16 11:20:59 2017 -0700
@@ -113,6 +113,12 @@
     }
 
     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));
     }