summaryrefslogtreecommitdiff
path: root/ext/intl/intl_error.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2009-12-23 21:41:05 +0000
committerStanislav Malyshev <stas@php.net>2009-12-23 21:41:05 +0000
commit882a89fb227915c4fd1cecb9f13850f90e80020c (patch)
tree22a8caa276e2c64615957f901685f6890445765b /ext/intl/intl_error.c
parentf0c1cd512f53c787058d40f025bbbed529122309 (diff)
downloadphp-git-882a89fb227915c4fd1cecb9f13850f90e80020c.tar.gz
cleanup some code, improve error handling
Diffstat (limited to 'ext/intl/intl_error.c')
-rwxr-xr-xext/intl/intl_error.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index 79ae153bbe..9c2e13dfd5 100755
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -44,10 +44,9 @@ static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC )
if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
return;
- if( !err->free_custom_error_message )
- return;
-
- efree( err->custom_error_message );
+ if(err->free_custom_error_message ) {
+ efree( err->custom_error_message );
+ }
err->custom_error_message = NULL;
err->free_custom_error_message = 0;
@@ -181,6 +180,16 @@ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TS
}
/* }}} */
+/* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
+ * Set error code and message.
+ */
+void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
+{
+ intl_errors_set_code( err, code TSRMLS_CC );
+ intl_errors_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+}
+/* }}} */
+
/* {{{ void intl_errors_reset( intl_error* err )
*/
void intl_errors_reset( intl_error* err TSRMLS_DC )