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

Unified Diff: components/policy/core/common/preg_parser_win.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 6 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
Index: components/policy/core/common/preg_parser_win.cc
diff --git a/components/policy/core/common/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc
index 317c2d7ec4a3d50098f61154d0f54469336258fc..08e4fa272b96bc7bc8aa42b7fb4c59e03a724d8d 100644
--- a/components/policy/core/common/preg_parser_win.cc
+++ b/components/policy/core/common/preg_parser_win.cc
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/files/memory_mapped_file.h"
+#include "base/i18n/case_conversion.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
@@ -298,7 +299,9 @@ bool ReadFile(const base::FilePath& file_path,
break;
// Process the record if it is within the |root| subtree.
- if (base::StartsWith(key_name, root, false))
+ if (base::StartsWith(base::i18n::ToLower(key_name),
+ base::i18n::ToLower(root),
+ base::CompareCase::SENSITIVE))
HandleRecord(key_name.substr(root.size()), value, type, data, dict);
}

Powered by Google App Engine
This is Rietveld 408576698