Chromium Code Reviews| Index: processor/microdump.cc |
| diff --git a/processor/microdump.cc b/processor/microdump.cc |
| index bf628552932d253b476f587b3129e718dcad8873..414e13c0021ab3790f8af9c621334eaa57c28156 100644 |
| --- a/processor/microdump.cc |
| +++ b/processor/microdump.cc |
| @@ -76,6 +76,16 @@ std::vector<uint8_t> ParseHexBuf(const string& str) { |
| return buf; |
| } |
| +bool GetLine(std::istringstream* istream, string* str) { |
|
Primiano Tucci (use gerrit)
2015/06/18 10:59:39
Maybe add a comment explaining that this removes W
simonb (inactive)
2015/06/18 16:24:39
Removed from this review in later patch sets, sinc
|
| + if (std::getline(*istream, *str)) { |
| + if (str->size() > 0 && str->at(str->size() - 1) == '\r') { |
| + str->erase(str->size() - 1); |
| + } |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| } // namespace |
| namespace google_breakpad { |
| @@ -183,7 +193,7 @@ Microdump::Microdump(const string& contents) |
| string arch; |
| std::istringstream stream(contents); |
| - while (std::getline(stream, line)) { |
| + while (GetLine(&stream, &line)) { |
|
rmcilroy
2015/06/18 09:42:11
Is there a reason you needed to write your own Get
simonb (inactive)
2015/06/18 10:46:39
This is the diff from a separate code review that
|
| if (line.find(kGoogleBreakpadKey) == string::npos) { |
| continue; |
| } |
| @@ -214,7 +224,7 @@ Microdump::Microdump(const string& contents) |
| os_tokens >> arch; |
| os_tokens >> num_cpus; |
| os_tokens >> hw_arch; |
| - std::getline(os_tokens, os_version); |
| + GetLine(&os_tokens, &os_version); |
| os_version.erase(0, 1); // remove leading space. |
| system_info_->cpu = hw_arch; |