зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1061117 - [MTP] Correct the offset and component in "MozMtpDatabase::CreateEntryForFile", r=dhylands
This commit is contained in:
Родитель
d5b912700b
Коммит
8ecb6cc282
|
@ -363,13 +363,14 @@ MozMtpDatabase::CreateEntryForFile(const nsACString& aPath, DeviceStorageFile* a
|
|||
if (slash == kNotFound) {
|
||||
component.Rebind(aPath, 0, aPath.Length());
|
||||
} else {
|
||||
component.Rebind(aPath, slash, aPath.Length() - slash);
|
||||
component.Rebind(aPath, 0 , slash);
|
||||
}
|
||||
if (doFind) {
|
||||
MtpObjectHandle entryHandle = FindEntryByPath(component);
|
||||
if (entryHandle != 0) {
|
||||
// We found an entry.
|
||||
parent = entryHandle;
|
||||
offset = slash + 1 ;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -408,6 +409,7 @@ MozMtpDatabase::CreateEntryForFile(const nsACString& aPath, DeviceStorageFile* a
|
|||
|
||||
AddEntry(entry);
|
||||
parent = entry->mHandle;
|
||||
offset = slash + 1;
|
||||
} while (slash != kNotFound);
|
||||
|
||||
return parent; // parent will be entry->mHandle
|
||||
|
|
Загрузка…
Ссылка в новой задаче