Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2630)

Unified Diff: base/version.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/trace_event_synthetic_delay.cc ('k') | base/version_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/version.cc
diff --git a/base/version.cc b/base/version.cc
index 933356ea77c2f4f2faedb603fd0634b3be3c24e4..6318b350edcab328feb593a029534ae50b5b84b0 100644
--- a/base/version.cc
+++ b/base/version.cc
@@ -31,8 +31,6 @@ bool ParseVersionNumbers(const std::string& version_str,
for (std::vector<std::string>::const_iterator it = numbers.begin();
it != numbers.end(); ++it) {
- if (StartsWithASCII(*it, "+", false))
- return false;
int num;
if (!StringToInt(*it, &num))
return false;
@@ -44,8 +42,8 @@ bool ParseVersionNumbers(const std::string& version_str,
if (num > max)
return false;
- // This throws out leading zeros for the first item only.
- if (it == numbers.begin() && IntToString(num) != *it)
+ // This throws out things like +3, or 032.
+ if (IntToString(num) != *it)
return false;
parsed->push_back(static_cast<uint16>(num));
« no previous file with comments | « base/trace_event/trace_event_synthetic_delay.cc ('k') | base/version_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698