Use case-insensitive switch comparisons

This commit is contained in:
Samuel Attard 2018-01-31 17:35:09 -07:00 committed by Charles Kerr
parent 278c58055e
commit ce361a12e3

View file

@ -1390,7 +1390,8 @@ bool IsBlacklistedArg(const base::CommandLine::CharType* arg) {
if (prefix_length > 0) {
a += prefix_length;
std::string switch_name(a, strcspn(a, "="));
std::string switch_name =
base::ToLowerASCII(base::StringPiece(a, strcspn(a, "=")));
auto* iter = std::lower_bound(std::begin(kBlacklist), std::end(kBlacklist),
switch_name);
if (iter != std::end(kBlacklist) && switch_name == *iter) {