From 6a47dffde514b2510fac9a6842d0c1b160e42fc5 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 25 Sep 2015 17:12:28 -0700 Subject: updater: Skip empty lines in the transfer list file. We have the last line being empty as a result of android::base::Split("a\nb\n"), which leads to "missing command" warnings in the update. Just skip all the empty lines. Bug: 24373789 Change-Id: I5827e4600bd5cf0418d95477e4592fec47bbd3a9 --- updater/blockimg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index ddb474ffd..54f2b6ed7 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1428,6 +1428,10 @@ static Value* PerformBlockImageUpdate(const char* name, State* state, int /* arg // Subsequent lines are all individual transfer commands for (auto it = lines.cbegin() + start; it != lines.cend(); it++) { const std::string& line_str(*it); + if (line_str.empty()) { + continue; + } + char* line = strdup(line_str.c_str()); params.cmdname = strtok_r(line, " ", ¶ms.cpos); -- cgit v1.2.3