summaryrefslogtreecommitdiffstats
path: root/chrome/browser/privacy_blacklist
diff options
context:
space:
mode:
authoridanan@google.com <idanan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 20:01:09 +0000
committeridanan@google.com <idanan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 20:01:09 +0000
commita52b1cae064a01de97c59dc51ada747ebe327dde (patch)
tree4b99ee580b30b0979791932ba9da5f531ab5feff /chrome/browser/privacy_blacklist
parent9c1949e18f28d32516364feb5c000ea83fe37805 (diff)
downloadchromium_src-a52b1cae064a01de97c59dc51ada747ebe327dde.zip
chromium_src-a52b1cae064a01de97c59dc51ada747ebe327dde.tar.gz
chromium_src-a52b1cae064a01de97c59dc51ada747ebe327dde.tar.bz2
Support multiple EOL types in Privacy Blacklists
BUG=16932 TEST=none TBR=maruel Review URL: http://codereview.chromium.org/251078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/privacy_blacklist')
-rw-r--r--chrome/browser/privacy_blacklist/blacklist_io.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/privacy_blacklist/blacklist_io.cc b/chrome/browser/privacy_blacklist/blacklist_io.cc
index 0d33e42..9c61b12 100644
--- a/chrome/browser/privacy_blacklist/blacklist_io.cc
+++ b/chrome/browser/privacy_blacklist/blacklist_io.cc
@@ -19,6 +19,7 @@ const char header[] = "[Chromium::PrivacyBlacklist]";
const char name_tag[] = "Name:";
const char url_tag[] = "URL:";
const char arrow_tag[] = "=>";
+const char eol[] = "\n\r";
class IsWhiteSpace {
public:
@@ -121,11 +122,11 @@ bool BlacklistIO::Read(const FilePath& file) {
scoped_ptr<Blacklist::Entry> entry(new Blacklist::Entry(pattern, provider));
cur = std::find_if(cur+arraysize(arrow_tag), end, IsNotWhiteSpace());
- skip = std::find(cur, end, '\n');
+ skip = std::find_first_of(cur, end, eol, eol+2);
std::string buf(cur, skip);
cur = skip + 1;
- StringTokenizer tokenier(buf, " (),");
+ StringTokenizer tokenier(buf, " (),\n\r");
tokenier.set_options(StringTokenizer::RETURN_DELIMS);
bool in_attribute = false;