version 1.71, 2006/03/17 08:51:45 |
version 1.72, 2006/03/17 13:40:41 |
|
|
(void)fclose(fp); |
(void)fclose(fp); |
} |
} |
|
|
|
/* |
|
* a hack to mimic and thus match gnu cvs behaviour. |
|
*/ |
|
time_t |
|
cvs_hack_time(time_t oldtime, int togmt) |
|
{ |
|
int l; |
|
struct tm *t; |
|
char tbuf[32]; |
|
|
|
if (togmt == 1) { |
|
t = gmtime(&oldtime); |
|
if (t == NULL) |
|
return (0); |
|
|
|
return (mktime(t)); |
|
} |
|
|
|
t = localtime(&oldtime); |
|
|
|
l = snprintf(tbuf, sizeof(tbuf), "%d/%d/%d GMT %d:%d:%d", |
|
t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour, |
|
t->tm_min, t->tm_sec); |
|
if (l == -1 || l >= (int)sizeof(tbuf)) |
|
return (0); |
|
|
|
return (cvs_date_parse(tbuf)); |
|
} |
|
|
#endif /* !RCSPROG */ |
#endif /* !RCSPROG */ |
|
|
/* |
/* |
|
|
cvs_freelines(dlines); |
cvs_freelines(dlines); |
cvs_freelines(plines); |
cvs_freelines(plines); |
return (res); |
return (res); |
} |
|
|
|
/* |
|
* a hack to mimic and thus match gnu cvs behaviour. |
|
*/ |
|
time_t |
|
cvs_hack_time(time_t oldtime, int togmt) |
|
{ |
|
int l; |
|
struct tm *t; |
|
char tbuf[32]; |
|
|
|
if (togmt == 1) { |
|
t = gmtime(&oldtime); |
|
if (t == NULL) |
|
return (0); |
|
|
|
return (mktime(t)); |
|
} |
|
|
|
t = localtime(&oldtime); |
|
|
|
l = snprintf(tbuf, sizeof(tbuf), "%d/%d/%d GMT %d:%d:%d", |
|
t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour, |
|
t->tm_min, t->tm_sec); |
|
if (l == -1 || l >= (int)sizeof(tbuf)) |
|
return (0); |
|
|
|
return (cvs_date_parse(tbuf)); |
|
} |
} |
|
|
/* |
/* |