Fix logic error in RFC 850 kluge.

This commit is contained in:
Garrett Wollman 1999-01-15 17:10:31 +00:00
parent c146843096
commit 9caa4ddf6b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42703

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: http.c,v 1.22 1998/12/08 13:00:49 cracauer Exp $ * $Id: http.c,v 1.23 1999/01/15 16:56:22 wollman Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -1429,8 +1429,9 @@ parse_http_date(char *string)
time(&now); time(&now);
tmnow = gmtime(&now); tmnow = gmtime(&now);
this2dyear = tmnow->tm_year % 100; this2dyear = tmnow->tm_year % 100;
if (tm.tm_year - this2dyear >= 50) tm.tm_year += tmnow->tm_year - this2dyear;
tm.tm_year += 100; if (tm.tm_year - tmnow->tm_year >= 50)
tm.tm_year -= 100;
} }
#undef digit #undef digit