Make FS OS X detection work for OpenJDK

OpenJDK sets the os.name system.property to "Darwin", while Apple's
version says "Mac OS X".

Change-Id: If08f8e7b8ef94ec00023a3f78bbf502ebd9699fb
This commit is contained in:
Robin Rosenberg 2012-05-20 10:45:03 +02:00
parent b61d35e848
commit 20c33e6b0c
2 changed files with 4 additions and 5 deletions

View File

@ -1015,10 +1015,9 @@ private static boolean isValidPath(CanonicalTreeParser t) {
}
private static boolean isValidPathSegment(CanonicalTreeParser t) {
boolean isWindows = "Windows".equals(SystemReader.getInstance()
.getProperty("os.name"));
boolean isOSX = "Mac OS X".equals(SystemReader.getInstance()
.getProperty("os.name"));
String osName = SystemReader.getInstance().getProperty("os.name");
boolean isWindows = "Windows".equals(osName);
boolean isOSX = "Darwin".equals(osName) || "Mac OS X".equals(osName);
boolean ignCase = isOSX || isWindows;
int ptr = t.getNameOffset();

View File

@ -105,6 +105,6 @@ public String run() {
return System.getProperty("os.name");
}
});
return "Mac OS X".equals(osDotName);
return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName);
}
}