systzdata fix from Michael Heimpold
This commit is contained in:
parent
09a2b5fb93
commit
f0bec845ff
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
Add support for use of the system timezone database, rather
|
Add support for use of the system timezone database, rather
|
||||||
than embedding a copy. Discussed upstream but was not desired.
|
than embedding a copy. Discussed upstream but was not desired.
|
||||||
|
|
||||||
History:
|
History:
|
||||||
|
r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
|
||||||
r8: fix compile error without --with-system-tzdata configured
|
r8: fix compile error without --with-system-tzdata configured
|
||||||
r7: improve check for valid timezone id to exclude directories
|
r7: improve check for valid timezone id to exclude directories
|
||||||
r6: fix fd leak in r5, fix country code/BC flag use in
|
r6: fix fd leak in r5, fix country code/BC flag use in
|
||||||
@ -16,9 +16,9 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
|
|||||||
r2: add filesystem trawl to set up name alias index
|
r2: add filesystem trawl to set up name alias index
|
||||||
r1: initial revision
|
r1: initial revision
|
||||||
|
|
||||||
--- php-5.3.1/ext/date/lib/parse_tz.c.systzdata
|
--- a/ext/date/lib/parse_tz.c
|
||||||
+++ php-5.3.1/ext/date/lib/parse_tz.c
|
+++ b/ext/date/lib/parse_tz.c
|
||||||
@@ -20,6 +20,16 @@
|
@@ -24,6 +24,16 @@
|
||||||
|
|
||||||
#include "timelib.h"
|
#include "timelib.h"
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ r1: initial revision
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
@@ -31,7 +41,12 @@
|
@@ -35,7 +45,12 @@
|
||||||
#else
|
#else
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
@ -48,7 +48,7 @@ r1: initial revision
|
|||||||
|
|
||||||
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
|
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
|
||||||
# if defined(__LITTLE_ENDIAN__)
|
# if defined(__LITTLE_ENDIAN__)
|
||||||
@@ -51,9 +66,14 @@
|
@@ -55,9 +70,14 @@
|
||||||
|
|
||||||
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ r1: initial revision
|
|||||||
/* read BC flag */
|
/* read BC flag */
|
||||||
tz->bc = (**tzf == '\1');
|
tz->bc = (**tzf == '\1');
|
||||||
*tzf += 1;
|
*tzf += 1;
|
||||||
@@ -253,7 +273,397 @@ void timelib_dump_tzinfo(timelib_tzinfo
|
@@ -260,7 +280,397 @@ void timelib_dump_tzinfo(timelib_tzinfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ r1: initial revision
|
|||||||
{
|
{
|
||||||
int left = 0, right = tzdb->index_size - 1;
|
int left = 0, right = tzdb->index_size - 1;
|
||||||
#ifdef HAVE_SETLOCALE
|
#ifdef HAVE_SETLOCALE
|
||||||
@@ -292,36 +702,125 @@ static int seek_to_tz_position(const uns
|
@@ -299,36 +709,125 @@ static int seek_to_tz_position(const uns
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,6 +473,7 @@ r1: initial revision
|
|||||||
+ char **map, size_t *maplen,
|
+ char **map, size_t *maplen,
|
||||||
+ const timelib_tzdb *tzdb)
|
+ const timelib_tzdb *tzdb)
|
||||||
+{
|
+{
|
||||||
|
+#ifdef HAVE_SYSTEM_TZDATA
|
||||||
+ if (tzdb == timezonedb_system) {
|
+ if (tzdb == timezonedb_system) {
|
||||||
+ char *orig;
|
+ char *orig;
|
||||||
+
|
+
|
||||||
@ -486,7 +487,9 @@ r1: initial revision
|
|||||||
+
|
+
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+ else {
|
+ else
|
||||||
|
+#endif
|
||||||
|
+ {
|
||||||
+ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
|
+ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
@ -594,8 +597,8 @@ r1: initial revision
|
|||||||
} else {
|
} else {
|
||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
}
|
}
|
||||||
--- php-5.3.1/ext/date/lib/timelib.m4.systzdata
|
--- a/ext/date/lib/timelib.m4
|
||||||
+++ php-5.3.1/ext/date/lib/timelib.m4
|
+++ b/ext/date/lib/timelib.m4
|
||||||
@@ -78,3 +78,17 @@ stdlib.h
|
@@ -78,3 +78,17 @@ stdlib.h
|
||||||
|
|
||||||
dnl Check for strtoll, atoll
|
dnl Check for strtoll, atoll
|
2
php.spec
2
php.spec
@ -82,7 +82,7 @@ Patch7: php-5.3.0-recode.patch
|
|||||||
# Functional changes
|
# Functional changes
|
||||||
Patch40: php-5.4.0-dlopen.patch
|
Patch40: php-5.4.0-dlopen.patch
|
||||||
Patch41: php-5.4.0-easter.patch
|
Patch41: php-5.4.0-easter.patch
|
||||||
Patch42: php-5.3.1-systzdata-v8.patch
|
Patch42: php-5.3.1-systzdata-v9.patch
|
||||||
# See http://bugs.php.net/53436
|
# See http://bugs.php.net/53436
|
||||||
Patch43: php-5.4.0-phpize.patch
|
Patch43: php-5.4.0-phpize.patch
|
||||||
# Use system libzip instead of bundled one
|
# Use system libzip instead of bundled one
|
||||||
|
Loading…
Reference in New Issue
Block a user