diff options
| author | Ross Smith II <aria2spam@smithii.com> | 2008-11-22 20:28:50 +0000 |
|---|---|---|
| committer | Ross Smith II <aria2spam@smithii.com> | 2008-11-22 20:28:50 +0000 |
| commit | 67d5d6d55efa708889dc41792bbfeb7983166790 (patch) | |
| tree | a27c58b96bd9d349f12c23e35611e324a326c09e /src/FtpConnection.cc | |
| parent | 5faa91e24c7af82d1643f862295c413528ee8776 (diff) | |
Applied aria2-1.0.0-mingw-r5.patch
Diffstat (limited to 'src/FtpConnection.cc')
| -rw-r--r-- | src/FtpConnection.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 60f24db3..49d8a15a 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -367,7 +367,24 @@ unsigned int FtpConnection::receiveMdtmResponse(Time& time) char buf[15]; // YYYYMMDDhhmmss+\0, milli second part is dropped. sscanf(response.second.c_str(), "%*u %14s", buf); if(strlen(buf) == 14) { +#ifdef HAVE_STRPTIME time = Time::parse(buf, "%Y%m%d%H%M%S"); +#else // !HAVE_STRPTIME + struct tm tm; + memset(&tm, 0, sizeof(tm)); + tm.tm_sec = Util::parseInt(&buf[12]); + buf[12] = '\0'; + tm.tm_min = Util::parseInt(&buf[10]); + buf[10] = '\0'; + tm.tm_hour = Util::parseInt(&buf[8]); + buf[8] = '\0'; + tm.tm_mday = Util::parseInt(&buf[6]); + buf[6] = '\0'; + tm.tm_mon = Util::parseInt(&buf[4])-1; + buf[4] = '\0'; + tm.tm_year = Util::parseInt(&buf[0])-1900; + time = Time(timegm(&tm)); +#endif // !HAVE_STRPTIME } else { time = Time::null(); } |
