Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More OS name canonicalization.
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent f97e725 commit 82ea40f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -4060,10 +4060,12 @@ public static SixModelObject jvmgetproperties(ThreadContext tc) {
for (String envName : env.stringPropertyNames()) {
String propVal = env.getProperty(envName);
if (envName.equals("os.name")) {
// Normalize OS name (handles the Windows case, maybe others
// are also needed).
if (propVal.startsWith("Windows"))
// Normalize OS name (some cases likely missing).
String pvlc = propVal.toLowerCase();
if (pvlc.indexOf("win") >= 0)
propVal = "MSWin32";
else if (pvlc.indexOf("mac os x") >= 0)
propVal = "darwin";
}
res.bind_key_boxed(tc, envName, box_s(propVal, strType, tc));
}
Expand Down

0 comments on commit 82ea40f

Please sign in to comment.