Version: support CRLF line feed in MANIFEST

When a MANIFEST is generated from Windows and it contains CRLF as line
feed, the code was getting each line with '\r' at the end, and thus the
parsed string contains '\r' and it incorrectly parses the string.

Add a piece of code to support CRLF line feed so support such MANIFEST
files.

Tested: Update the unit test case to verify CRLF is correctly handled.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I872bb59dbde5647e833f5c335357a3f6ae0765a5
diff --git a/version.cpp b/version.cpp
index adaaeb9..91f478b 100644
--- a/version.cpp
+++ b/version.cpp
@@ -51,6 +51,12 @@
         efile.open(manifestFilePath);
         while (getline(efile, line))
         {
+            if (!line.empty() && line.back() == '\r')
+            {
+                // If the manifest has CRLF line terminators, e.g. is created on
+                // Windows, the line will contain \r at the end, remove it.
+                line.pop_back();
+            }
             if (line.compare(0, keySize, key) == 0)
             {
                 value = line.substr(keySize);