aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ftp.c9
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 736a0dd..a441bcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
diff --git a/ftp.c b/ftp.c
index 613a9a1..232c6a6 100644
--- a/ftp.c
+++ b/ftp.c
@@ -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