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

Unified Diff: net/ftp/ftp_directory_listing_parser_netware.cc

Issue 1120012: Fix the "ls -l" style date parser to correctly guess the year if it is not provided. (Closed)
Patch Set: better comments Created 10 years, 9 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
Index: net/ftp/ftp_directory_listing_parser_netware.cc
diff --git a/net/ftp/ftp_directory_listing_parser_netware.cc b/net/ftp/ftp_directory_listing_parser_netware.cc
index 20d2b25308dd442f6d2f486af08e886d212f2061..60c6c6a0dc42fe527831025791c2b955c3462559 100644
--- a/net/ftp/ftp_directory_listing_parser_netware.cc
+++ b/net/ftp/ftp_directory_listing_parser_netware.cc
@@ -31,8 +31,10 @@ bool LooksLikeNetwarePermissionsListing(const string16& text) {
namespace net {
-FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware()
- : received_first_line_(false) {
+FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware(
+ const base::Time& current_time)
+ : received_first_line_(false),
+ current_time_(current_time) {
}
bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) {
@@ -75,7 +77,7 @@ bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) {
// Netware uses the same date listing format as Unix "ls -l".
if (!FtpUtil::LsDateListingToTime(columns[4], columns[5], columns[6],
- &entry.last_modified)) {
+ current_time_, &entry.last_modified)) {
return false;
}
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_netware.h ('k') | net/ftp/ftp_directory_listing_parser_netware_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698