aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/util/OS.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/util/OS.java b/src/main/java/com/google/devtools/build/lib/util/OS.java
index ee2e6d4cd4..04e437b8f2 100644
--- a/src/main/java/com/google/devtools/build/lib/util/OS.java
+++ b/src/main/java/com/google/devtools/build/lib/util/OS.java
@@ -49,8 +49,13 @@ public enum OS {
osName = System.getProperty("os.name");
}
+ if (osName == null) {
+ return OS.UNKNOWN;
+ }
+
for (OS os : OS.values()) {
- if (os.detectionName.equals(osName)) {
+ // Windows have many names, all starting with "Windows".
+ if (osName.startsWith(os.detectionName)) {
return os;
}
}