From 2416a50b5a329a5f2d28b4caa45a965b8d601e96 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Tue, 12 Apr 2016 19:54:46 -0500 Subject: Rewrite TWRP fstab flag processing * Do not flip/flop between std::string and char* when no std::string specific functions are applied. * Remove the need to manually count flag string lengths * Move checks for Display_Name, Storage_Name, and Backup_Display_Name out of flag processing Change-Id: I24d432c222124012b2a98d27598e42d0944f7da2 --- twrp-functions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'twrp-functions.cpp') diff --git a/twrp-functions.cpp b/twrp-functions.cpp index 8d85ccf04..1c633e7e4 100644 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -305,6 +305,13 @@ std::string TWFunc::Remove_Trailing_Slashes(const std::string& path, bool leaveL return res; } +void TWFunc::Strip_Quotes(char* &str) { + if (strlen(str) > 0 && str[0] == '\"') + str++; + if (strlen(str) > 0 && str[strlen(str)-1] == '\"') + str[strlen(str)-1] = 0; +} + vector TWFunc::split_string(const string &in, char del, bool skip_empty) { vector res; -- cgit v1.2.3