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

Unified Diff: base/command_line.cc

Issue 11184050: [content shell] add support for getting tests from the command line. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 2 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 | « no previous file | base/command_line_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.cc
diff --git a/base/command_line.cc b/base/command_line.cc
index 983181fc7a613edd133905a4759369ac61fee3a0..29467e3196b41a328f6de6e3eefaae26af7d2aed 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -50,7 +50,8 @@ bool IsSwitch(const CommandLine::StringType& string,
CommandLine::StringType* switch_value) {
switch_string->clear();
switch_value->clear();
- if (GetSwitchPrefixLength(string) == 0)
+ size_t prefix_length = GetSwitchPrefixLength(string);
+ if (prefix_length == 0 || prefix_length == string.length())
return false;
const size_t equals_position = string.find(kSwitchValueSeparator);
« no previous file with comments | « no previous file | base/command_line_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698