| Index: net/ftp/ftp_directory_listing_parser_ls.cc
|
| ===================================================================
|
| --- net/ftp/ftp_directory_listing_parser_ls.cc (revision 131350)
|
| +++ net/ftp/ftp_directory_listing_parser_ls.cc (working copy)
|
| @@ -51,21 +51,6 @@
|
| LooksLikeUnixPermission(text.substr(4, 3)));
|
| }
|
|
|
| -bool LooksLikePermissionDeniedError(const string16& text) {
|
| - // Try to recognize a three-part colon-separated error message:
|
| - //
|
| - // 1. ftpd server name
|
| - // 2. directory name (often just ".")
|
| - // 3. message text (usually "Permission denied")
|
| - std::vector<string16> parts;
|
| - base::SplitString(CollapseWhitespace(text, false), ':', &parts);
|
| -
|
| - if (parts.size() != 3)
|
| - return false;
|
| -
|
| - return parts[2].find(ASCIIToUTF16("Permission denied")) != string16::npos;
|
| -}
|
| -
|
| // Returns the column index of the end of the date listing and detected
|
| // last modification time.
|
| bool DetectColumnOffsetAndModificationTime(const std::vector<string16>& columns,
|
| @@ -159,10 +144,11 @@
|
| current_time,
|
| &column_offset,
|
| &entry.last_modified)) {
|
| - // If we can't recognize a normal listing line, maybe it's an error?
|
| - // In that case, just ignore the error, but still recognize the data
|
| - // as valid listing.
|
| - if (LooksLikePermissionDeniedError(lines[i]))
|
| + // Some servers send a message in one of the first few lines.
|
| + // All those messages have in common is the string ".:",
|
| + // where "." means the current directory, and ":" separates it
|
| + // from the rest of the message, which may be empty.
|
| + if (lines[i].find(ASCIIToUTF16(".:")) != string16::npos)
|
| continue;
|
|
|
| return false;
|
|
|