Merge "print out md5s to recovery.log" into twrp2.7
diff --git a/data.cpp b/data.cpp
index be76592..c766f00 100644
--- a/data.cpp
+++ b/data.cpp
@@ -556,8 +556,7 @@
 		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);
diff --git a/minui/graphics.c b/minui/graphics.c
index 4968eac..9ee77b3 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -223,7 +223,12 @@
     *y = gr_font->cheight;
 }
 
-int gr_text(int x, int y, const char *s, int bold)
+int gr_text(int x, int y, const char *s, ...)
+{
+    return gr_text_impl(x, y, s, 0);
+}
+
+int gr_text_impl(int x, int y, const char *s, int bold)
 {
     GGLContext *gl = gr_context;
     GRFont *font = gr_font;
diff --git a/minui/minui.h b/minui/minui.h
index 1b8dd05..ccd501f 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -37,7 +37,12 @@
 
 void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
 void gr_fill(int x1, int y1, int x2, int y2);
-int gr_text(int x, int y, const char *s, int bold);
+
+// system/core/charger uses different gr_print signatures in diferent
+// Android versions, either with or without int bold.
+int gr_text(int x, int y, const char *s, ...);
+int gr_text_impl(int x, int y, const char *s, int bold);
+
  void gr_texticon(int x, int y, gr_surface icon);
 int gr_measure(const char *s);
 void gr_font_size(int *x, int *y);
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index bb472bf..88b3829 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -98,6 +98,8 @@
 				LOGINFO("command is: '%s' and ", command);
 				val_start = script_line;
 				val_start += cindex + 1;
+				if ((int) *val_start == 32)
+					val_start++; //get rid of space
 				if ((int) *val_start == 51)
 					val_start++; //get rid of = at the beginning
 				strncpy(value, val_start, line_len - cindex - remove_nl);