summaryrefslogtreecommitdiffstats
path: root/openrecoveryscript.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-06-17 23:52:29 +0200
committerEthan Yonker <dees_troy@teamw.in>2015-06-17 23:58:16 +0200
commit6511c4d178cc7bef260cafecf07e874d334d0ed6 (patch)
tree445559ccf0c17dee8f8703f34f2264a55d68769d /openrecoveryscript.cpp
parentMake sure that adbd restarts after sideload (diff)
downloadandroid_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar.gz
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar.bz2
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar.lz
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar.xz
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.tar.zst
android_bootable_recovery-6511c4d178cc7bef260cafecf07e874d334d0ed6.zip
Diffstat (limited to 'openrecoveryscript.cpp')
-rw-r--r--openrecoveryscript.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 75686cfcc..cf6f598c5 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -309,12 +309,17 @@ int OpenRecoveryScript::run_script_file(void) {
gui_print("Unmounted '%s'\n", mount);
} else if (strcmp(command, "set") == 0) {
// Set value
+ size_t len = strlen(value);
tok = strtok(value, " ");
strcpy(value1, tok);
- tok = strtok(NULL, " ");
- strcpy(value2, tok);
- gui_print("Setting '%s' to '%s'\n", value1, value2);
- DataManager::SetValue(value1, value2);
+ if (len > strlen(value1) + 1) {
+ char *val2 = value + strlen(value1) + 1;
+ gui_print("Setting '%s' to '%s'\n", value1, val2);
+ DataManager::SetValue(value1, val2);
+ } else {
+ gui_print("Setting '%s' to empty\n", value1);
+ DataManager::SetValue(value1, "");
+ }
} else if (strcmp(command, "mkdir") == 0) {
// Make directory (recursive)
DataManager::SetValue("tw_action_text2", "Making Directory");