diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:59 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:59 -0400 |
commit | ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (patch) | |
tree | acdb9a8816483652a9db1a47db71df5df43707c5 /ext/recode | |
parent | 10f5b47dc7c1cf2b9a00991629f43652710322d3 (diff) | |
download | php-ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61.tar.gz |
Imported Upstream version 5.1.1upstream/5.1.1
Diffstat (limited to 'ext/recode')
-rw-r--r-- | ext/recode/config.m4 | 10 | ||||
-rw-r--r-- | ext/recode/config9.m4 | 2 | ||||
-rw-r--r-- | ext/recode/php_recode.h | 4 | ||||
-rw-r--r-- | ext/recode/recode.c | 43 |
4 files changed, 23 insertions, 36 deletions
diff --git a/ext/recode/config.m4 b/ext/recode/config.m4 index 476bd7d3f..f4ef31513 100644 --- a/ext/recode/config.m4 +++ b/ext/recode/config.m4 @@ -1,9 +1,9 @@ dnl -dnl $Id: config.m4,v 1.11 2003/10/01 02:53:14 sniper Exp $ +dnl $Id: config.m4,v 1.13 2005/05/29 23:16:44 sniper Exp $ dnl PHP_ARG_WITH(recode,for recode support, -[ --with-recode[=DIR] Include recode support.]) +[ --with-recode[=DIR] Include recode support]) if test "$PHP_RECODE" != "no"; then RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" @@ -12,17 +12,17 @@ if test "$PHP_RECODE" != "no"; then if test -f $i/include/recode.h; then RECODE_DIR=$i RECODE_INC=include - RECODE_LIB=lib + RECODE_LIB=$PHP_LIBDIR fi if test -f $i/include/recode/recode.h; then RECODE_DIR=$i RECODE_INC=include/recode - RECODE_LIB=lib/recode + RECODE_LIB=$PHP_LIBDIR/recode fi if test -f $i/recode/include/recode.h; then RECODE_DIR=$i/recode RECODE_INC=include - RECODE_LIB=lib + RECODE_LIB=$PHP_LIBDIR fi test -n "$RECODE_DIR" && break done diff --git a/ext/recode/config9.m4 b/ext/recode/config9.m4 index b7bb5e266..1595f4fb6 100644 --- a/ext/recode/config9.m4 +++ b/ext/recode/config9.m4 @@ -1,5 +1,5 @@ dnl -dnl $Id: config9.m4,v 1.1.2.1 2004/12/21 02:53:34 sniper Exp $ +dnl $Id: config9.m4,v 1.2 2004/11/09 16:11:13 jorton Exp $ dnl dnl Check for extensions with which Recode can not work diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h index 1302e8d7a..37bcedef1 100644 --- a/ext/recode/php_recode.h +++ b/ext/recode/php_recode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | + | Copyright (c) 1997-2005 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_recode.h,v 1.16 2004/01/08 17:32:43 sniper Exp $ */ +/* $Id: php_recode.h,v 1.17 2005/08/03 14:07:43 sniper Exp $ */ #ifndef PHP_RECODE_H #define PHP_RECODE_H diff --git a/ext/recode/recode.c b/ext/recode/recode.c index e790768d7..bbdb8e9f2 100644 --- a/ext/recode/recode.c +++ b/ext/recode/recode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | + | Copyright (c) 1997-2005 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: recode.c,v 1.35 2004/01/08 08:17:22 andi Exp $ */ +/* $Id: recode.c,v 1.37 2005/08/03 14:07:43 sniper Exp $ */ /* {{{ includes & prototypes */ @@ -119,7 +119,7 @@ PHP_MINFO_FUNCTION(recode) { php_info_print_table_start(); php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.35 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.37 $"); php_info_print_table_end(); } @@ -129,7 +129,6 @@ PHP_FUNCTION(recode_string) { RECODE_REQUEST request = NULL; char *r = NULL; - bool success; int r_len = 0, r_alen = 0; int req_len, str_len; char *req, *str; @@ -144,9 +143,8 @@ PHP_FUNCTION(recode_string) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure"); RETURN_FALSE; } - - success = recode_scan_request(request, req); - if (!success) { + + if (!recode_scan_request(request, req)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req); goto error_exit; } @@ -154,19 +152,14 @@ PHP_FUNCTION(recode_string) recode_buffer_to_buffer(request, str, str_len, &r, &r_len, &r_alen); if (!r) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed."); - goto error_exit; - } - - RETVAL_STRINGL(r, r_len, 1); - free(r); - /* FALLTHROUGH */ - error_exit: - if (request) - recode_delete_request(request); + RETVAL_FALSE; + } else { + RETVAL_STRINGL(r, r_len, 1); + free(r); + } - if (!r) - RETURN_FALSE; + recode_delete_request(request); return; } @@ -177,7 +170,6 @@ error_exit: PHP_FUNCTION(recode_file) { RECODE_REQUEST request = NULL; - int success; zval **req; zval **input, **output; php_stream *instream, *outstream; @@ -206,26 +198,21 @@ PHP_FUNCTION(recode_file) RETURN_FALSE; } - success = recode_scan_request(request, Z_STRVAL_PP(req)); - if (!success) { + if (!recode_scan_request(request, Z_STRVAL_PP(req))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req)); goto error_exit; } - success = recode_file_to_file(request, in_fp, out_fp); - if (!success) { + if (!recode_file_to_file(request, in_fp, out_fp)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed."); goto error_exit; } - if (request) - recode_delete_request(request); + recode_delete_request(request); RETURN_TRUE; error_exit: - if (request) - recode_delete_request(request); - + recode_delete_request(request); RETURN_FALSE; } /* }}} */ |