Remove extra slashes from zip path in openrecovery
TWFunc::Get_Path() returns a path with a trailing slash and the substr
method is returning a string with a leading slash, so we don't need to
specify additional slashes for wholePath in Locate_Zip_File().
Also, put 'value' readout to log on its own line if it exists.
Change-Id: I2a4db6dbde5552f5a803eabb0599fd983d683fca
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 1461f2d..0b71a42 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -105,7 +105,7 @@
remove_nl = 1;
if (cindex != 0) {
strncpy(command, script_line, cindex);
- LOGINFO("command is: '%s' and ", command);
+ LOGINFO("command is: '%s'\n", command);
val_start = script_line;
val_start += cindex + 1;
if ((int) *val_start == 32)
@@ -477,11 +477,11 @@
while (pos != string::npos)
{
pathCpy = Path.substr(pos, Path.size() - pos);
- wholePath = pathCpy + "/" + File;
+ wholePath = pathCpy + File;
LOGINFO("Looking for zip at '%s'\n", wholePath.c_str());
if (TWFunc::Path_Exists(wholePath))
return wholePath;
- wholePath = Storage_Root + "/" + wholePath;
+ wholePath = Storage_Root + wholePath;
LOGINFO("Looking for zip at '%s'\n", wholePath.c_str());
if (TWFunc::Path_Exists(wholePath))
return wholePath;