* fix previous in a more portable manner (timegm() is not portable/standard).

use mktime(), and adjust to GMT as per code in util.c::remotemodtime()
This commit is contained in:
lukem 1998-11-12 22:27:17 +00:00
parent b148b1ea84
commit fa954d84d1

View File

@ -1,4 +1,4 @@
/* $NetBSD: fetch.c,v 1.37 1998/11/12 18:19:02 itohy Exp $ */
/* $NetBSD: fetch.c,v 1.38 1998/11/12 22:27:17 lukem Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fetch.c,v 1.37 1998/11/12 18:19:02 itohy Exp $");
__RCSID("$NetBSD: fetch.c,v 1.38 1998/11/12 22:27:17 lukem Exp $");
#endif /* not lint */
/*
@ -530,12 +530,20 @@ url_get(url, proxyenv, outfile)
|| (t = strptime(cp,
"%a, %b %d %H:%M:%S %Y",
&parsed))) {
parsed.tm_isdst = -1;
if (*t == '\0')
mtime = timegm(&parsed);
if (debug && mtime != -1)
mtime = mktime(&parsed);
if (debug && mtime != -1) {
#ifndef __SVR4
/* conv. local -> GMT */
mtime += parsed.tm_gmtoff;
#else
mtime -= timezone;
#endif
fprintf(ttyout,
"parsed date as: %s",
ctime(&mtime));
}
}
#define LOCATION "Location: "
} else if (isredirected &&