[ 
https://issues.apache.org/jira/browse/IO-600?focusedWorklogId=528814&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-528814
 ]

ASF GitHub Bot logged work on IO-600:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Dec/20 15:06
            Start Date: 28/Dec/20 15:06
    Worklog Time Spent: 10m 
      Work Description: 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 528814)
    Time Spent: 40m  (was: 0.5h)

> getPrefixLength returns wrong length on linux for filename "C:"
> ---------------------------------------------------------------
>
>                 Key: IO-600
>                 URL: https://issues.apache.org/jira/browse/IO-600
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 2.6
>            Reporter: Patrick Bender
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> On most unix filesystems only null byte and / are reserved characters. So its 
> perfectly valid to have a file called "C:".
> If the getPrefixLength method is called for the path of such a file then it 
> returns 2 whereas the expected value is 0.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to