cvs: php-src /ext/date php_date.c
| From: | Derick Rethans | Date: | Wed, 03 Jan 2007 14:46:52 +0000 |
| Subject: | cvs: php-src /ext/date php_date.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42530@lists.php.net to get a copy of this message | ||
derick Wed Jan 3 14:46:52 2007 UTC
Modified files:
/php-src/ext/date php_date.c
Log:
- MFB: Fixed bug #40012 (php_date.c doesnt compile on Netware).
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.127&r2=1.128&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.127 php-src/ext/date/php_date.c:1.128
--- php-src/ext/date/php_date.c:1.127 Mon Jan 1 09:29:22 2007
+++ php-src/ext/date/php_date.c Wed Jan 3 14:46:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.127 2007/01/01 09:29:22 sebastian Exp $ */
+/* $Id: php_date.c,v 1.128 2007/01/03 14:46:52 derick Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -628,6 +628,14 @@
}
return tzid;
}
+#elif defined(NETWARE)
+ /* Try to guess timezone from system information */
+ {
+ char *tzid = timelib_timezone_id_from_abbr("", ((_timezone * -1) + (daylightOffset *
daylightOnOff)), daylightOnOff);
+ if (tzid) {
+ return tzid;
+ }
+ }
#endif
/* Fallback to UTC */
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC'
because your platform doesn't provide functionality for the guessing algorithm");
@@ -2218,7 +2226,7 @@
PHP_FUNCTION(timezone_name_from_abbr)
{
char *abbr;
- char *tzname;
+ char *tzid;
int abbr_len;
long gmtoffset = -1;
long isdst = -1;
@@ -2226,10 +2234,10 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &abbr, &abbr_len,
&gmtoffset, &isdst) == FAILURE) {
RETURN_FALSE;
}
- tzname = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
+ tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
- if (tzname) {
- RETURN_STRING(tzname, 1);
+ if (tzid) {
+ RETURN_STRING(tzid, 1);
} else {
RETURN_FALSE;
}