Fix zip folder selection when storage path is similar

If internal is /sdcard and external is /sdcard-ext then the zip
path used to stay on /sdcard-ext when trying to switch to internal
storage. Using Get_Root_Path instead of resizing will ensure that
the path changes properly.
This commit is contained in:
Dees Troy
2013-09-10 00:16:24 +00:00
parent 84f683a322
commit c2e9bc74a1

View File

@@ -556,8 +556,7 @@ void DataManager::SetBackupFolder()
if (zip_path.size() < storage_path.size()) {
SetValue(TW_ZIP_LOCATION_VAR, storage_path);
} else {
zip_root= zip_path;
zip_root.resize(storage_path.size());
zip_root = TWFunc::Get_Root_Path(zip_path);
if (zip_root != storage_path) {
LOGINFO("DataManager::SetBackupFolder zip path was %s changing to %s, %s\n", zip_path.c_str(), storage_path.c_str(), zip_root.c_str());
SetValue(TW_ZIP_LOCATION_VAR, storage_path);