commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hippo spark (JIRA)" <j...@apache.org>
Subject [jira] Created: (IO-248) getFullPathNoEndSeparator return empty while path is one level directory
Date Tue, 14 Sep 2010 10:10:32 GMT
getFullPathNoEndSeparator return empty while path is one level directory
------------------------------------------------------------------------

                 Key: IO-248
                 URL: https://issues.apache.org/jira/browse/IO-248
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.4
         Environment: linux 2.6.x 32bit java version 1.6.0_20 OpenJDK 
            Reporter: hippo spark
            Priority: Minor


the getFullPathNoEndSeparator method in FilenameUtils.java (Revision 736890) 
if filename="/" return "/" <<==right
if filename="/abc" return empty <<==bug
if filename="/abc/xyz" return "/abc" <<==right 


code:

885 	 int index = indexOfLastSeparator(filename);
886 	if (index < 0) {
887 	return filename.substring(0, prefix);
888 	}
889 	int end = index + (includeSeparator ? 1 : 0);
================
                if(end==0) return "/"
>>>>>>>>>>>>>>>>
890 	return filename.substring(0, end); 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message