diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-15 12:12:47 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-15 12:12:47 +0000 |
commit | c795d4380f62bf14243de5a41a7d65e6de02f468 (patch) | |
tree | 995b3bd9d9b5dd9e18674f98c409cde8aa9948e5 | |
parent | [w3m-dev 03573] Re: Bug#172851: w3m: In form, takes hostname as baseref for r... (diff) | |
download | w3m-c795d4380f62bf14243de5a41a7d65e6de02f468.tar.gz w3m-c795d4380f62bf14243de5a41a7d65e6de02f468.zip |
[w3m-dev 03574] Re: preserve timestamp
* ftp.c (getFtpModtime): don't call localtime,gettime in same expr
From: Takahashi Youichirou <nikuq@hk.airnet.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ftp.c | 9 |
2 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2002-12-15 Takahashi Youichirou <nikuq@hk.airnet.ne.jp> + + * [w3m-dev 03574] Re: preserve timestamp + * ftp.c (getFtpModtime): don't call localtime,gettime in same expr + 2002-12-15 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev 03573] Re: Bug#172851: w3m: In form, takes hostname as baseref for relative URI action @@ -5873,4 +5878,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.623 2002/12/14 16:09:51 ukai Exp $ +$Id: ChangeLog,v 1.624 2002/12/15 12:12:47 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: ftp.c,v 1.17 2002/12/14 15:26:44 ukai Exp $ */ +/* $Id: ftp.c,v 1.18 2002/12/15 12:12:47 ukai Exp $ */ #include <stdio.h> #include <pwd.h> #include <Str.h> @@ -357,7 +357,7 @@ getFtpModtime(FTP ftp, char *path) Str tmp; char *p; struct tm tm; - time_t t; + time_t t, lt, gt; memset(&tm, 0, sizeof(struct tm)); tmp = Sprintf("MDTM %s\r\n", path); @@ -374,8 +374,9 @@ getFtpModtime(FTP ftp, char *path) tm.tm_year -= 1900; tm.tm_mon--; t = mktime(&tm); - t += mktime(localtime(&t)) - mktime(gmtime(&t)); - return t; + lt = mktime(localtime(&t)); + gt = mktime(gmtime(&t)); + return t + (lt - gt); } int |