MTP Fix rename in Windows

Change-Id: Ieef2fc16aac1da3d03908cfb285895954b42a14a
This commit is contained in:
Dees Troy
2014-09-04 15:01:30 +00:00
parent 53ea0a166c
commit 2e07c0493e
3 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -644,7 +644,7 @@ int MtpStorage::renameObject(MtpObjectHandle handle, std::string newName) {
std::string newFullName = parentdir + "/" + newName;
MTPD("old: '%s', new: '%s'\n", oldName.c_str(), newFullName.c_str());
if (rename(oldName.c_str(), newFullName.c_str()) == 0) {
node->setPath(newFullName);
node->rename(newFullName);
return 0;
} else {
MTPE("MtpStorage::renameObject failed, handle: %d, new name: '%s'\n", handle, newName.c_str());