Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Normalize $*OS on Windows to be MSWin32.
Many things identify Windows in this way at present.
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent 6b4b034 commit 3898d17
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -4051,8 +4051,16 @@ public static SixModelObject jvmgetproperties(ThreadContext tc) {
SixModelObject res = hashType.st.REPR.allocate(tc, hashType.st);

Properties env = System.getProperties();
for (String envName : env.stringPropertyNames())
res.bind_key_boxed(tc, envName, box_s(env.getProperty(envName), strType, 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"))
propVal = "MSWin32";
}
res.bind_key_boxed(tc, envName, box_s(propVal, strType, tc));
}

return res;
}
Expand Down

0 comments on commit 3898d17

Please sign in to comment.