OSDN Git Service

[automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129...
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>
Fri, 1 Jun 2018 21:46:11 +0000 (21:46 +0000)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>
Fri, 1 Jun 2018 21:46:11 +0000 (21:46 +0000)
Change-Id: I66ce047987d59d1344cd46e14e07ae0d3cb4bf9a

Utils.cpp

index 014055b..43014bd 100644 (file)
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -211,17 +211,17 @@ static status_t readMetadata(const std::string& path, std::string& fsType,
     for (auto line : output) {
         // Extract values from blkid output, if defined
         const char* cline = line.c_str();
-        char* start = strstr(cline, "TYPE=");
+        char* start = strstr(cline, "TYPE=\"");
         if (start != nullptr && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
             fsType = value;
         }
 
-        start = strstr(cline, "UUID=");
+        start = strstr(cline, "UUID=\"");
         if (start != nullptr && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
             fsUuid = value;
         }
 
-        start = strstr(cline, "LABEL=");
+        start = strstr(cline, "LABEL=\"");
         if (start != nullptr && sscanf(start + 6, "\"%127[^\"]\"", value) == 1) {
             fsLabel = value;
         }