From 0d9a62e40926a4e89c7c1e0b0ea72ce5e0350e46 Mon Sep 17 00:00:00 2001 From: Mohd Faraz Date: Thu, 20 Feb 2020 00:10:26 +0530 Subject: [PATCH] Remove Extra spaces occured while using multiline string variable * On multiline string variable it adds spaces Change-Id: I0f9140f3840b0238009af2271ac67b25754f76c9 Signed-off-by: Mohd Faraz --- Android.mk | 2 +- twrp.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index ca204d39..89eb7c63 100755 --- a/Android.mk +++ b/Android.mk @@ -151,7 +151,7 @@ else LOCAL_SHARED_LIBRARIES += libcrypto endif -ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0) LOCAL_SHARED_LIBRARIES += libbase endif diff --git a/twrp.cpp b/twrp.cpp index f81bdf91..7689c253 100755 --- a/twrp.cpp +++ b/twrp.cpp @@ -43,6 +43,11 @@ extern "C" { #include "twrp-functions.hpp" #include "data.hpp" #include "partitions.hpp" +#ifdef __ANDROID_API_N__ +#include +#else +#include +#endif #include "openrecoveryscript.hpp" #include "variables.h" #include "twrpAdbBuFifo.hpp" @@ -161,6 +166,8 @@ int main(int argc, char **argv) { } else { other_prop = current_prop; } + other_prop = android::base::Trim(other_prop); + current_prop = android::base::Trim(current_prop); string sys_val = TWFunc::System_Property_Get(other_prop, SarPartitionManager, "/s"); if (!sys_val.empty()) { LOGINFO("Overriding %s with value: \"%s\" from system property %s\n", current_prop.c_str(), sys_val.c_str(), other_prop.c_str());