projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Note 'new' commands.
[mmh]
/
sbr
/
dtime.c
diff --git
a/sbr/dtime.c
b/sbr/dtime.c
index
57b61c8
..
1435955
100644
(file)
--- a/
sbr/dtime.c
+++ b/
sbr/dtime.c
@@
-3,13
+3,17
@@
* dtime.c -- time/date routines
*
* $Id$
* dtime.c -- time/date routines
*
* $Id$
+ *
+ * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
*/
#include <h/mh.h> /* for snprintf() */
#include <h/nmh.h>
#include <h/tws.h>
*/
#include <h/mh.h> /* for snprintf() */
#include <h/nmh.h>
#include <h/tws.h>
-#if !defined(HAVE_TM_GMTOFF) && !defined(HAVE_TZSET)
+#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_TZSET)
# include <sys/timeb.h>
#endif
# include <sys/timeb.h>
#endif
@@
-24,7
+28,7
@@
# endif
#endif
# endif
#endif
-#if !defined(HAVE_TM_GMTOFF) && defined(HAVE_TZSET)
+#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && defined(HAVE_TZSET)
extern int daylight;
extern long timezone;
extern char *tzname[];
extern int daylight;
extern long timezone;
extern char *tzname[];
@@
-138,7
+142,7
@@
dlocaltime (time_t *clock)
static struct tws tw;
struct tm *tm;
static struct tws tw;
struct tm *tm;
-#if !defined(HAVE_TM_GMTOFF) && !defined(HAVE_TZSET)
+#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_TZSET)
struct timeb tb;
#endif
struct timeb tb;
#endif
@@
-165,7
+169,7
@@
dlocaltime (time_t *clock)
if (tm->tm_isdst)
tw.tw_flags |= TW_DST;
if (tm->tm_isdst)
tw.tw_flags |= TW_DST;
-#ifdef HAVE_TM_GMTOFF
+#ifdef HAVE_STRUCT_TM_TM_GMTOFF
tw.tw_zone = tm->tm_gmtoff / 60;
if (tm->tm_isdst) /* if DST is in effect */
tw.tw_zone -= 60; /* reset to normal offset */
tw.tw_zone = tm->tm_gmtoff / 60;
if (tm->tm_isdst) /* if DST is in effect */
tw.tw_zone -= 60; /* reset to normal offset */
@@
-412,8
+416,11
@@
dmktime (struct tws *tw)
year = tw->tw_year;
result = 0;
year = tw->tw_year;
result = 0;
- if (year < 100)
- year += 1900;
+ if (year < 1970)
+ year += 1900;
+
+ if (year < 1970)
+ year += 100;
for (i = 1970; i < year; i++)
result += dysize (i);
for (i = 1970; i < year; i++)
result += dysize (i);