You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/12/28 15:06:13 UTC

[GitHub] [commons-io] IchbinkeinReh commented on a change in pull request #178: IO-600: fix getPrefixLength for Linux filename

IchbinkeinReh commented on a change in pull request #178:
URL: https://github.com/apache/commons-io/pull/178#discussion_r549379524



##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -665,7 +666,10 @@ public static int getPrefixLength(final String fileName) {
         if (ch1 == ':') {
             ch0 = Character.toUpperCase(ch0);
             if (ch0 >= 'A' && ch0 <= 'Z') {
-                if (len == 2 || isSeparator(fileName.charAt(2)) == false) {
+                if (len == 2 && SystemUtils.IS_OS_LINUX) {

Review comment:
       I think you can use "!FilenameUtils.isSystemWindows()" instead. see https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/FilenameUtils.java#L146




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org