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

Unified Diff: net/ftp/ftp_directory_listing_parser.cc

Issue 2613093003: Landing again: "Make FTP directory parser less strict" (Closed)
Patch Set: Created 3 years, 11 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 | « net/data/ftp/dir-listing-ls-34.expected ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parser.cc
diff --git a/net/ftp/ftp_directory_listing_parser.cc b/net/ftp/ftp_directory_listing_parser.cc
index 151c1b9df56ea4a1f17d9c7294be0fdd8dbf32fb..1096ae01f62180bcdc8516969a340d93d618f49f 100644
--- a/net/ftp/ftp_directory_listing_parser.cc
+++ b/net/ftp/ftp_directory_listing_parser.cc
@@ -28,7 +28,7 @@ int FillInRawName(const std::string& encoding,
std::vector<FtpDirectoryListingEntry>* entries) {
for (size_t i = 0; i < entries->size(); i++) {
if (!base::UTF16ToCodepage(entries->at(i).name, encoding.c_str(),
- base::OnStringConversionError::FAIL,
+ base::OnStringConversionError::SUBSTITUTE,
&entries->at(i).raw_name)) {
return ERR_ENCODING_CONVERSION_FAILED;
}
@@ -91,7 +91,7 @@ int DecodeAndParse(const std::string& text,
base::string16 converted_text;
if (base::CodepageToUTF16(text, encoding_name,
- base::OnStringConversionError::FAIL,
+ base::OnStringConversionError::SUBSTITUTE,
&converted_text)) {
const char* const kNewlineSeparators[] = {"\n", "\r\n"};
« no previous file with comments | « net/data/ftp/dir-listing-ls-34.expected ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698