about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTFTP.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2000-01-07 03:20:24 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2000-01-07 03:20:24 -0500
commitd61bc4e56055c372ab0b8d027f376c2f4a2ecfff (patch)
tree8d4e0da5b7cf703c2167d84dc84b54669183bba1 /WWW/Library/Implementation/HTFTP.c
parentf61041c10496785b2833ee4f76ef3edc9792b1bd (diff)
downloadlynx-snapshots-d61bc4e56055c372ab0b8d027f376c2f4a2ecfff.tar.gz
snapshot of project "lynx", label v2-8-3dev_18
Diffstat (limited to 'WWW/Library/Implementation/HTFTP.c')
-rw-r--r--WWW/Library/Implementation/HTFTP.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index d2a41a12..cd6d5b57 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1279,7 +1279,6 @@ PRIVATE void set_years_and_date NOARGS
 	day[0] = '0';
     }
     strncpy(month, (char *)ctime(&NowTime)+4, 3);
-    strncpy(month, (char *)ctime(&NowTime)+4, 3);
     month[3] = '\0';
     for (i = 0; i < 12; i++) {
 	if (!strcasecomp(month, months[i])) {
@@ -2459,7 +2458,11 @@ PRIVATE int compare_EntryInfo_structs ARGS2(
 		if (date1[6] == ' ' || date1[6] == HT_NON_BREAK_SPACE) {
 		    date1[6] = '0';
 		}
-		if (date1[0] == '9' && atoi(date1) > TheDate) {
+		/*  If no year given, assume last year if it would otherwise
+		 *  be in the future by more than one day.  The one day
+		 *  tolerance is to account for a possible timezone
+		 *  difference. - kw */
+		if (date1[0] == '9' && atoi(date1) > TheDate + 1) {
 		    for (i = 0; i < 4; i++) {
 			date1[i] = LastYear[i];
 		    }
@@ -2490,7 +2493,11 @@ PRIVATE int compare_EntryInfo_structs ARGS2(
 		if (date2[6] == ' ' || date2[6] == HT_NON_BREAK_SPACE) {
 		    date2[6] = '0';
 		}
-		if (date2[0] == '9' && atoi(date2) > TheDate) {
+		/*  If no year given, assume last year if it would otherwise
+		 *  be in the future by more than one day.  The one day
+		 *  tolerance is to account for a possible timezone
+		 *  difference. - kw */
+		if (date2[0] == '9' && atoi(date2) > TheDate + 1) {
 		    for (i = 0; i < 4; i++) {
 			date2[i] = LastYear[i];
 		    }
@@ -2546,6 +2553,13 @@ PRIVATE int read_directory ARGS4(
     _HTProgress (gettext("Receiving FTP directory."));
 
     /*
+     *  Force the current Date and Year (TheDate, ThisYear, and LastYear)
+     *  to be recalculated for each directory request.  Otherwise we have
+     *  a problem with long-running sessions assuming the wrong date for
+     *  today. - kw
+     */
+    HaveYears = FALSE;
+    /*
     **	Check whether we always want the home
     **	directory treated as Welcome. - FM
     */