summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthat <github@that.at>2015-06-01 23:36:57 +0200
committerthat <github@that.at>2015-06-01 23:36:57 +0200
commitc7b631b7a2cb8581147083ce2a4f2e369c8d496b (patch)
treefbecd75d06c30085275c68b7a783b8beb59b2582
parentFix double free crash during encrypted backups (diff)
downloadandroid_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar.gz
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar.bz2
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar.lz
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar.xz
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.tar.zst
android_bootable_recovery-c7b631b7a2cb8581147083ce2a4f2e369c8d496b.zip
-rw-r--r--gui/action.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 97d95f170..265d6de0f 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -995,15 +995,19 @@ int GUIAction::flash(std::string arg)
// We're going to jump to this page first, like a loading page
gui_changePage(arg);
for (i=0; i<zip_queue_index; i++) {
+ string zip_path = zip_queue[i];
+ size_t slashpos = zip_path.find_last_of('/');
+ string zip_filename = (slashpos == string::npos) ? zip_path : zip_path.substr(slashpos + 1);
operation_start("Flashing");
- DataManager::SetValue("tw_filename", zip_queue[i]);
+ DataManager::SetValue("tw_filename", zip_path);
+ DataManager::SetValue("tw_file", zip_filename);
DataManager::SetValue(TW_ZIP_INDEX, (i + 1));
TWFunc::SetPerformanceMode(true);
- ret_val = flash_zip(zip_queue[i], &wipe_cache);
+ ret_val = flash_zip(zip_path, &wipe_cache);
TWFunc::SetPerformanceMode(false);
if (ret_val != 0) {
- gui_print("Error flashing zip '%s'\n", zip_queue[i].c_str());
+ gui_print("Error flashing zip '%s'\n", zip_path.c_str());
ret_val = 1;
break;
}