[
https://issues.apache.org/jira/browse/CB-7602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14206681#comment-14206681
]
ASF subversion and git services commented on CB-7602:
-----------------------------------------------------
Commit 0b5096eab58fd3333d5aa4d55460e8423e2aa27a in cordova-plugin-file's branch
refs/heads/master from [~iclelland]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=0b5096e ]
CB-7602: Fix isCopyOnItself logic
It should not treat /a/bc/ as a subdirectory of /a/b/
> isCopyOnItself check returns invalid result when moving directory
> -----------------------------------------------------------------
>
> Key: CB-7602
> URL: https://issues.apache.org/jira/browse/CB-7602
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android, Plugin File
> Affects Versions: 3.5.0
> Reporter: Tom Good
> Assignee: Ian Clelland
> Labels: copyTo, moveTo
>
> When using moveTo to move a directory the isCopyOnItself check fails if the
> directory name starts the same but is different. Example:
> Source:
> /storage/emulated/0/GalileoMobile
> Destination:
> /storage/emulated/0/GalileoMobileBackup/GalileoMobile
> The issue is with the indexof check looking for any slash following the
> partial match.
> Existing Line 305 of LocalFileSystem.java:
> 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
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]