Merge "init: remove extra space in list of bootconfig values" am: 53ad66f41b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1757971 Change-Id: I5f52a0ffa05fac0b9e8c762853c4f91ec6c90974
This commit is contained in:
commit
706013153c
1 changed files with 4 additions and 2 deletions
|
@ -253,8 +253,10 @@ void ImportBootconfig(const std::function<void(const std::string&, const std::st
|
|||
for (const auto& entry : android::base::Split(bootconfig, "\n")) {
|
||||
std::vector<std::string> pieces = android::base::Split(entry, "=");
|
||||
if (pieces.size() == 2) {
|
||||
pieces[1].erase(std::remove(pieces[1].begin(), pieces[1].end(), '"'), pieces[1].end());
|
||||
fn(android::base::Trim(pieces[0]), android::base::Trim(pieces[1]));
|
||||
// get rid of the extra space between a list of values and remove the quotes.
|
||||
std::string value = android::base::StringReplace(pieces[1], "\", \"", ",", true);
|
||||
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
|
||||
fn(android::base::Trim(pieces[0]), android::base::Trim(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue