MF 0.6: 1.4->1.5:
Provide -1 value for tm_isdst in non-tz-secs cases.
This commit is contained in:
parent
df37fa6cae
commit
a4727055dd
|
@ -217,7 +217,7 @@ scheme_value date2time(int sec, int min, int hour,
|
||||||
|
|
||||||
d.tm_sec = sec; d.tm_min = min; d.tm_hour = hour;
|
d.tm_sec = sec; d.tm_min = min; d.tm_hour = hour;
|
||||||
d.tm_mday = mday; d.tm_mon = month; d.tm_year = year;
|
d.tm_mday = mday; d.tm_mon = month; d.tm_year = year;
|
||||||
d.tm_wday = 0; d.tm_yday = 0; d.tm_isdst = summer;
|
d.tm_wday = 0; d.tm_yday = 0;
|
||||||
|
|
||||||
if( FIXNUMP(tz_secs) ) { /* Offset from GMT in seconds. */
|
if( FIXNUMP(tz_secs) ) { /* Offset from GMT in seconds. */
|
||||||
char **oldenv = environ; /* Set TZ to UTC */
|
char **oldenv = environ; /* Set TZ to UTC */
|
||||||
|
@ -232,12 +232,16 @@ scheme_value date2time(int sec, int min, int hour,
|
||||||
environ = oldenv;
|
environ = oldenv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ### Note that we *still* don't implement the manual paragraph
|
||||||
|
with "When calcultating with time-zones, the date's SUMMER?
|
||||||
|
field is used to resolve ambiguities. */
|
||||||
else if( STRINGP(tz_name) ) { /* Time zone */
|
else if( STRINGP(tz_name) ) { /* Time zone */
|
||||||
char *newenv[2];
|
char *newenv[2];
|
||||||
char **oldenv = make_newenv(tz_name, newenv);
|
char **oldenv = make_newenv(tz_name, newenv);
|
||||||
if( !oldenv ) return ENTER_FIXNUM(errno);
|
if( !oldenv ) return ENTER_FIXNUM(errno);
|
||||||
tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */
|
tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
d.tm_isdst = -1;
|
||||||
t = mktime(&d);
|
t = mktime(&d);
|
||||||
if( t == -1 ) return ENTER_FIXNUM(errno ? errno : -1);
|
if( t == -1 ) return ENTER_FIXNUM(errno ? errno : -1);
|
||||||
revert_env(oldenv);
|
revert_env(oldenv);
|
||||||
|
@ -246,6 +250,7 @@ scheme_value date2time(int sec, int min, int hour,
|
||||||
else { /* Local time */
|
else { /* Local time */
|
||||||
tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */
|
tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
d.tm_isdst = -1;
|
||||||
t = mktime(&d);
|
t = mktime(&d);
|
||||||
if( t == -1) return ENTER_FIXNUM(errno ? errno : -1);
|
if( t == -1) return ENTER_FIXNUM(errno ? errno : -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue