зеркало из https://github.com/mozilla/gecko-dev.git
Bug 873065 - Use DEVICESTORAGE_SDCARD for unknown file types. r=dhylands
The method DeviceStorageFile::CreateUnique fails for files with an unknown extension. It calls DeviceStorageFileChecker::GetTypeFromFileName to retrieve the default location. The returned value is "Unknown", which is passed to the constructor of DeviceStorageFile. This class doesn't handle "Unknown" in it's initialization, and fails without creating a file. This patch changes the default return value of GetTypeFromFileName to the constant DEVICESTORAGE_SDCARD. All files with unknown extension will now be stored on the sd card.
This commit is contained in:
Родитель
a44d6902af
Коммит
90691b7347
|
@ -334,7 +334,7 @@ DeviceStorageTypeChecker::GetTypeFromFile(nsIFile* aFile, nsAString& aType)
|
|||
void
|
||||
DeviceStorageTypeChecker::GetTypeFromFileName(const nsAString& aFileName, nsAString& aType)
|
||||
{
|
||||
aType.AssignLiteral("Unknown");
|
||||
aType.AssignLiteral(DEVICESTORAGE_SDCARD);
|
||||
|
||||
nsString fileName(aFileName);
|
||||
int32_t dotIdx = fileName.RFindChar(PRUnichar('.'));
|
||||
|
|
Загрузка…
Ссылка в новой задаче