Fix Recursive_Mkdir if path doesn't end with "/"
Somewhat surprisingly, Recursive_Mkdir(TWRES "customlanguages")
did not create the "customlanguages" directory because it expected
a trailing slash. Fixed by rewriting the loop to be more like
Create_Dir_Recursive.
Also fixed error handling for the final directory, and fixed incorrect
return value handling for "mkdir" ORS command.
Change-Id: I1ab418ddda695cbb595a9db2817f00fc7b171f51
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 30c03b1..eee64ff 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -323,8 +323,8 @@
// Make directory (recursive)
DataManager::SetValue("tw_action_text2", gui_parse_text("{@making_dir1}"));
gui_msg(Msg("making_dir2=Making directory: '{1}'")(value));
- if (TWFunc::Recursive_Mkdir(value)) {
- gui_msg(Msg(msg::kError, "create_folder_strerr=Can not create '{1}' folder ({2}).")(value)(strerror(errno)));
+ if (!TWFunc::Recursive_Mkdir(value)) {
+ // error message already displayed by Recursive_Mkdir
ret_val = 1;
}
} else if (strcmp(command, "reboot") == 0) {