]> granicus.if.org Git - php/commitdiff
MF5 fixes
authorStanislav Malyshev <stas@php.net>
Sun, 10 May 2009 21:01:38 +0000 (21:01 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 10 May 2009 21:01:38 +0000 (21:01 +0000)
ext/intl/intl_data.h
ext/intl/intl_error.c

index ac5e4c387bf6ad98f621013360df2015fd4a8ec9..0d39fd175455e293e9d62a74f5dd1809203fb64c 100755 (executable)
@@ -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();                                                                                                                                  \
index 82f715774e73908eb75c7a5bd85faf26947165ca..fd105e9296ec352445dc4d40ee5b9a2413b826c2 100755 (executable)
@@ -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 );
 }
 /* }}} */