Skip to content

Commit d08dbbf

Browse files
committed
Bullet-proofing.
1 parent f0751b6 commit d08dbbf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/FileSystem.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.commons.io;
1919

2020
import java.util.Arrays;
21+
import java.util.Locale;
2122
import java.util.Objects;
2223

2324
/**
@@ -76,7 +77,7 @@ public enum FileSystem {
7677
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
7778
* </p>
7879
*/
79-
private static final boolean IS_OS_LINUX = getOsMatchesName("Linux") || getOsMatchesName("LINUX");
80+
private static final boolean IS_OS_LINUX = getOsMatchesName("Linux");
8081

8182
/**
8283
* <p>
@@ -174,7 +175,7 @@ private static boolean isOsNameMatch(final String osName, final String osNamePre
174175
if (osName == null) {
175176
return false;
176177
}
177-
return osName.startsWith(osNamePrefix);
178+
return osName.toUpperCase(Locale.ROOT).startsWith(osNamePrefix.toUpperCase(Locale.ROOT));
178179
}
179180

180181
private final char[] illegalFileNameChars;

0 commit comments

Comments
 (0)