mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Replace use of localtime with localtime_r.
This commit is contained in:
parent
cff51866dd
commit
e0b8a67d33
@ -1,5 +1,8 @@
|
|||||||
2009-09-03 Micah Cowan <micah@cowan.name>
|
2009-09-03 Micah Cowan <micah@cowan.name>
|
||||||
|
|
||||||
|
* ftp-ls.c (ftp_parse_vms_ls): Replace use of localtime_r with
|
||||||
|
localtime, as not all platforms have localtime_r.
|
||||||
|
|
||||||
* Makefile.am (wget_SOURCES): Rearranged some of the file order,
|
* Makefile.am (wget_SOURCES): Rearranged some of the file order,
|
||||||
so .c files and .h files are apart. Added gettext.h, so that it
|
so .c files and .h files are apart. Added gettext.h, so that it
|
||||||
shows up in the dist.
|
shows up in the dist.
|
||||||
|
@ -675,7 +675,7 @@ ftp_parse_vms_ls (const char *file)
|
|||||||
int dt, i, j, len;
|
int dt, i, j, len;
|
||||||
int perms;
|
int perms;
|
||||||
time_t timenow;
|
time_t timenow;
|
||||||
struct tm timestruct;
|
struct tm *timestruct;
|
||||||
char date_str[ 32];
|
char date_str[ 32];
|
||||||
|
|
||||||
char *line, *tok; /* tokenizer */
|
char *line, *tok; /* tokenizer */
|
||||||
@ -961,11 +961,11 @@ ftp_parse_vms_ls (const char *file)
|
|||||||
fails.
|
fails.
|
||||||
*/
|
*/
|
||||||
timenow = time( NULL);
|
timenow = time( NULL);
|
||||||
localtime_r( &timenow, ×truct);
|
timestruct = localtime( &timenow );
|
||||||
strptime( date_str, "%d-%b-%Y %H:%M:%S", ×truct);
|
strptime( date_str, "%d-%b-%Y %H:%M:%S", timestruct);
|
||||||
|
|
||||||
/* Convert struct tm local time to time_t local time. */
|
/* Convert struct tm local time to time_t local time. */
|
||||||
timenow = mktime (×truct);
|
timenow = mktime (timestruct);
|
||||||
/* Offset local time according to environment variable (seconds). */
|
/* Offset local time according to environment variable (seconds). */
|
||||||
if ((tok = getenv( "WGET_TIMEZONE_DIFFERENTIAL")) != NULL)
|
if ((tok = getenv( "WGET_TIMEZONE_DIFFERENTIAL")) != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user