Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-248

getFullPathNoEndSeparator return empty while path is one level directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4
    • 2.0
    • Utilities
    • None
    • linux 2.6.x 32bit java version 1.6.0_20 OpenJDK

    Description

      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

      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);
      

      Attachments

        Activity

          People

            niallp Niall Pemberton
            hippospark hippo spark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: