cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Good (JIRA)" <>
Subject [jira] [Created] (CB-7602) isCopyOnItself check fails when moving directory
Date Fri, 19 Sep 2014 17:54:33 GMT
Tom Good created CB-7602:

             Summary: isCopyOnItself check fails when moving directory
                 Key: CB-7602
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android, Plugin File
    Affects Versions: 3.5.0
            Reporter: Tom Good
            Priority: Minor

When using moveTo to move a directory the isCopyOnItself check fails if the directory name
starts the same.  Example:


The issue is with the indexof check looking for any slash.
Existing Line 305 of
        if (dest.startsWith(src) && dest.indexOf(File.separator, src.length() - 1)
!= -1) {

Something like this should work:
      if (dest.equals(src) || dest.startsWith(src + File.separator) ) {

This would also occur with copies.

This message was sent by Atlassian JIRA

View raw message