summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-22 08:29:58 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-22 08:29:58 +0000
commit44cf56d6e70dbe06a160b004494ba40dd4cfb426 (patch)
tree10e665c60414c3070ce957e5c534e30ed499bc2d /time.c
parent4b4cad81e7d2bdc4750ea5043ce44bf37adb3997 (diff)
2000-06-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/time.c b/time.c
index 9028b7337d..a165bafe7f 100644
--- a/time.c
+++ b/time.c
@@ -316,6 +316,11 @@ make_time_t(tptr, utc_or_local)
tm = localtime(&guess);
if (!tm) goto error;
guess -= tm->tm_gmtoff;
+ tm = localtime(&guess);
+ if (!tm) goto error;
+ if (tm->tm_hour != tptr->tm_hour) {
+ guess += (tptr->tm_hour - tm->tm_hour)*3600;
+ }
#else
struct tm gt, lt;
long tzsec;
@@ -338,18 +343,17 @@ make_time_t(tptr, utc_or_local)
else {
tzsec += (gt.tm_yday - lt.tm_yday)*24*3600;
}
-
if (lt.tm_isdst) guess += 3600;
guess += tzsec;
if (guess < 0) {
goto out_of_range;
}
-#endif
tm = localtime(&guess);
if (!tm) goto error;
- if (tm->tm_hour != tptr->tm_hour) {
+ if (lt.tm_isdst != tm->tm_isdst) {
guess -= 3600;
}
+#endif
if (guess < 0) {
goto out_of_range;
}