diff options
| author | Rohit Yengisetty <rohit@cyngn.com> | 2015-03-05 16:35:21 -0800 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-03-21 14:29:28 +0000 |
| commit | df97de0cff704f0bfbd70fffe0f3cee346dbfa15 (patch) | |
| tree | ea1133b13e9e943c230073aac8deb6a057daf33d /src/com/cyanogenmod/filemanager/util/CommandHelper.java | |
| parent | 2185846e4a2927563263c15a7a09061d0f7624a7 (diff) | |
CM File Manager - Gracefully handle renaming on case-insensitive filesystems
Add edge case handling to move/copy commands wherein something is being
renamed to a different-cased version of itself.
Ex : renaming 'mydocuments' to 'MyDocuments'
https://jira.cyanogenmod.org/browse/BACON-3074
Change-Id: Id90de5fd083e341371f250c0194f200388cf4941
Diffstat (limited to 'src/com/cyanogenmod/filemanager/util/CommandHelper.java')
| -rw-r--r-- | src/com/cyanogenmod/filemanager/util/CommandHelper.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/util/CommandHelper.java b/src/com/cyanogenmod/filemanager/util/CommandHelper.java index 6c33a2f..de71798 100644 --- a/src/com/cyanogenmod/filemanager/util/CommandHelper.java +++ b/src/com/cyanogenmod/filemanager/util/CommandHelper.java @@ -766,10 +766,11 @@ public final class CommandHelper { CommandNotFoundException, OperationTimeoutException, ExecutionException, InvalidCommandDefinitionException, ReadOnlyFilesystemException, CancelledOperationException { + Console cSrc = ensureConsoleForFile(context, console, src); Console cDst = ensureConsoleForFile(context, console, dst); boolean ret = true; - if (cSrc.equals(cDst)) { + if (cSrc.equals(cDst) && !FileHelper.isSamePath(src, dst)) { // Is safe to use the same console MoveExecutable executable = cSrc.getExecutableFactory().newCreator().createMoveExecutable(src, dst); @@ -858,10 +859,11 @@ public final class CommandHelper { CommandNotFoundException, OperationTimeoutException, ExecutionException, InvalidCommandDefinitionException, ReadOnlyFilesystemException, CancelledOperationException { + Console cSrc = ensureConsoleForFile(context, console, src); Console cDst = ensureConsoleForFile(context, console, dst); boolean ret = true; - if (cSrc.equals(cDst)) { + if (cSrc.equals(cDst) && !FileHelper.isSamePath(src, dst)) { // Is safe to use the same console CopyExecutable executable = cSrc.getExecutableFactory().newCreator().createCopyExecutable(src, dst); |
