From: Stanislav Malyshev Date: Sun, 10 May 2009 21:01:38 +0000 (+0000) Subject: MF5 fixes X-Git-Tag: php-5.4.0alpha1~191^2~3704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30c805ad9a7c037579e481d5d8b15c5a56f3c230;p=php MF5 fixes --- diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index ac5e4c387b..0d39fd1754 100755 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h @@ -45,12 +45,12 @@ typedef struct _intl_data { obj = (oclass##_object *) zend_object_store_get_object( object TSRMLS_CC ); \ intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \ -// Check status by error code, if error - exit +/* Check status by error code, if error - exit */ #define INTL_CHECK_STATUS(err, msg) \ intl_error_set_code( NULL, (err) TSRMLS_CC ); \ if( U_FAILURE((err)) ) \ { \ - intl_errors_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ + intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \ RETURN_FALSE; \ } @@ -62,9 +62,9 @@ typedef struct _intl_data { RETURN_FALSE; \ } -#define INTL_MAX_LOCALE_LEN 64 +#define INTL_MAX_LOCALE_LEN 80 -// Check status, if error - destroy value and exit +/* Check status, if error - destroy value and exit */ #define INTL_CTOR_CHECK_STATUS(obj, msg) \ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \ @@ -77,14 +77,14 @@ typedef struct _intl_data { #define INTL_CHECK_LOCALE_LEN(locale_len) \ if((locale_len) > INTL_MAX_LOCALE_LEN) { \ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \ - "Locale string too long, should be no longer than 64 characters", 0 TSRMLS_CC ); \ + "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \ RETURN_NULL(); \ } #define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \ if((locale_len) > INTL_MAX_LOCALE_LEN) { \ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \ - "Locale string too long, should be no longer than 64 characters", 0 TSRMLS_CC ); \ + "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \ zval_dtor(object); \ ZVAL_NULL(object); \ RETURN_NULL(); \ diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index 82f715774e..fd105e9296 100755 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -182,7 +182,9 @@ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TS */ void intl_errors_reset( intl_error* err TSRMLS_DC ) { - intl_error_reset( err TSRMLS_CC ); + if(err) { + intl_error_reset( err TSRMLS_CC ); + } intl_error_reset( NULL TSRMLS_CC ); } /* }}} */ @@ -191,7 +193,9 @@ void intl_errors_reset( intl_error* err TSRMLS_DC ) */ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC ) { - intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + if(err) { + intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC ); + } intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC ); } /* }}} */ @@ -200,7 +204,9 @@ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_ */ void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC ) { - intl_error_set_code( err, err_code TSRMLS_CC ); + if(err) { + intl_error_set_code( err, err_code TSRMLS_CC ); + } intl_error_set_code( NULL, err_code TSRMLS_CC ); } /* }}} */