From d61bc4e56055c372ab0b8d027f376c2f4a2ecfff Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Fri, 7 Jan 2000 03:20:24 -0500 Subject: snapshot of project "lynx", label v2-8-3dev_18 --- WWW/Library/Implementation/HTFTP.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'WWW/Library/Implementation/HTFTP.c') 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]; } @@ -2545,6 +2552,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 -- cgit 1.4.1-2-gfad0