diff options
-rw-r--r-- | webkit/appcache/manifest_parser.cc | 2 | ||||
-rw-r--r-- | webkit/appcache/manifest_parser_unittest.cc | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/webkit/appcache/manifest_parser.cc b/webkit/appcache/manifest_parser.cc index 652582a..0f794f6 100644 --- a/webkit/appcache/manifest_parser.cc +++ b/webkit/appcache/manifest_parser.cc @@ -135,7 +135,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, const wchar_t *line_end = line_p + line.length(); // Look for whitespace separating the URL from subsequent ignored tokens. - while (line_p < line_end && *line_p != '\t' && *p != ' ') + while (line_p < line_end && *line_p != '\t' && *line_p != ' ') ++line_p; string16 url16; diff --git a/webkit/appcache/manifest_parser_unittest.cc b/webkit/appcache/manifest_parser_unittest.cc index 9fb42e0..e3e0ead 100644 --- a/webkit/appcache/manifest_parser_unittest.cc +++ b/webkit/appcache/manifest_parser_unittest.cc @@ -301,5 +301,17 @@ TEST(ManifestParserTest, UnusualUtf8) { EXPECT_TRUE(urls.find("http://bad.com/nonbmp%F1%84%AB%BC") != urls.end()); } +TEST(ManifestParserTest, IgnoreAfterSpace) { + Manifest manifest; + const GURL kUrl("http://smorg.borg"); + const std::string kData( + "CACHE MANIFEST\r" + "resource.txt this stuff after the white space should be ignored\r"); + EXPECT_TRUE(ParseManifest(kUrl, kData.c_str(), kData.length(), manifest)); + + base::hash_set<std::string> urls = manifest.explicit_urls; + EXPECT_TRUE(urls.find("http://smorg.borg/resource.txt") != urls.end()); +} + } // namespace appcache |