Chromium Code Reviews| Index: net/ftp/ftp_directory_listing_parser_ls.cc |
| diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc |
| index 9d637a8c9beb9a62a9b4caa6a81a3e04065acf12..f7ad6ac81ac48607d49d6f426a280f8f7b109e59 100644 |
| --- a/net/ftp/ftp_directory_listing_parser_ls.cc |
| +++ b/net/ftp/ftp_directory_listing_parser_ls.cc |
| @@ -98,6 +98,20 @@ bool DetectColumnOffsetAndModificationTime(const std::vector<string16>& columns, |
| } |
| } |
| + // Some FTP listings have swapped the "month" and "day of month" columns |
| + // (for example Russian listings). We try to recognize them only after making |
| + // sure no column offset works above (this is a more strict way). |
|
jungshik at Google
2011/04/01 18:28:41
the other day, the order would be always the same
|
| + for (size_t i = 5U; i < columns.size(); i++) { |
| + if (net::FtpUtil::LsDateListingToTime(columns[i - 1], |
| + columns[i - 2], |
| + columns[i], |
| + current_time, |
| + modification_time)) { |
| + *offset = i; |
| + return true; |
| + } |
| + } |
| + |
| return false; |
| } |