summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2005-06-18 11:15:29 +0000
committerDerick Rethans <derick@php.net>2005-06-18 11:15:29 +0000
commit30efc9f68e39a8d572ecc1918f87b0ddee80a141 (patch)
tree2a7db43ac08be8bffed390b52bfc5fd8a8722db7 /ext
parentdb861c394458cc42169750ab1050b3d668ec7092 (diff)
downloadphp-git-30efc9f68e39a8d572ecc1918f87b0ddee80a141.tar.gz
- Fixed a problem where the timestamp we are looking up a TZ info structure for
was in the last record in the tz database. - Fixed problem in test case.
Diffstat (limited to 'ext')
-rw-r--r--ext/date/lib/parse_tz.c2
-rw-r--r--ext/date/tests/bug27780.phpt4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index 4591c8f10f..e88f3b2fe5 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -233,7 +233,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts)
return &(tz->type[tz->trans_idx[i - 1]]);
}
}
- return NULL;
+ return &(tz->type[tz->trans_idx[tz->timecnt - 1]]);
}
static tlinfo* fetch_leaptime_offset(timelib_tzinfo *tz, timelib_sll ts)
diff --git a/ext/date/tests/bug27780.phpt b/ext/date/tests/bug27780.phpt
index 1c10340d47..f1e6eb67bd 100644
--- a/ext/date/tests/bug27780.phpt
+++ b/ext/date/tests/bug27780.phpt
@@ -99,8 +99,8 @@ Asia/Singapore
America/Sao_Paulo
1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
-1076810400 [2004-02-14 23:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
-1076810401 [2004-02-14 23:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
+1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
+1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours]