Index: net/ftp/ftp_util.cc |
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc |
index 00b23b7c10b771daea8da81324fbc4fcc9f4249a..956a95679df7821fa9613f40cecfc52685be03a7 100644 |
--- a/net/ftp/ftp_util.cc |
+++ b/net/ftp/ftp_util.cc |
@@ -285,8 +285,12 @@ bool FtpUtil::LsDateListingToTime(const base::string16& month, |
} |
} |
- // We don't know the time zone of the listing, so just use local time. |
- *result = base::Time::FromLocalExploded(time_exploded); |
+ // We don't know the time zone of the listing, so try both. |
maksims (do not use this acc)
2016/10/05 12:59:02
So, problem was here - it had been using a bad gue
mmenke
2016/10/05 16:53:38
Why is one succeeding, but the other failing? See
maksims (do not use this acc)
2016/10/06 12:07:07
ExplodedMostlyEquals() doesn't depend on that. The
mmenke
2016/10/06 15:36:54
I'm not comfortable with workarounding around the
|
+ if (!base::Time::FromLocalExploded(time_exploded, result)) { |
+ if (!base::Time::FromUTCExploded(time_exploded, result)) { |
+ return false; |
+ } |
+ } |
return true; |
} |
@@ -348,8 +352,12 @@ bool FtpUtil::WindowsDateListingToTime(const base::string16& date, |
} |
} |
- // We don't know the time zone of the server, so just use local time. |
- *result = base::Time::FromLocalExploded(time_exploded); |
+ // We don't know the time zone of the server, so try both. |
+ if (!base::Time::FromLocalExploded(time_exploded, result)) { |
+ if (!base::Time::FromUTCExploded(time_exploded, result)) { |
+ return false; |
+ } |
+ } |
return true; |
} |