[PHP-CVS] cvs: php4 /main main.c
sniper Wed Mar 19 03:22:12 2003 EDT Modified files: /php4/main main.c Log: Fixed bug #22775 (Fatal errors exit with status 0 with CGI/CLI) Index: php4/main/main.c diff -u php4/main/main.c:1.542 php4/main/main.c:1.543 --- php4/main/main.c:1.542 Tue Mar 18 17:21:54 2003 +++ php4/main/main.cWed Mar 19 03:22:12 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.542 2003/03/18 22:21:54 helly Exp $ */ +/* $Id: main.c,v 1.543 2003/03/19 08:22:12 sniper Exp $ */ /* {{{ includes */ @@ -698,6 +698,7 @@ /*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */ case E_COMPILE_ERROR: case E_USER_ERROR: + EG(exit_status) = 255; if (module_initialized) { zend_bailout(); efree(buffer); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /main main.c
sniper Wed Mar 19 03:22:36 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main main.c Log: MFH: Fixed bug #22775 (Fatal errors exit with status 0 with CGI/CLI) Index: php4/main/main.c diff -u php4/main/main.c:1.512.2.19 php4/main/main.c:1.512.2.20 --- php4/main/main.c:1.512.2.19 Tue Mar 18 17:43:00 2003 +++ php4/main/main.cWed Mar 19 03:22:35 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.512.2.19 2003/03/18 22:43:00 helly Exp $ */ +/* $Id: main.c,v 1.512.2.20 2003/03/19 08:22:35 sniper Exp $ */ /* {{{ includes */ @@ -717,6 +717,7 @@ /*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */ case E_COMPILE_ERROR: case E_USER_ERROR: + EG(exit_status) = 255; if (module_initialized) { zend_bailout(); efree(buffer); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
sniper Wed Mar 19 03:23:02 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: BFN Index: php4/NEWS diff -u php4/NEWS:1.1247.2.149 php4/NEWS:1.1247.2.150 --- php4/NEWS:1.1247.2.149 Tue Mar 18 10:21:33 2003 +++ php4/NEWS Wed Mar 19 03:23:02 2003 @@ -31,6 +31,7 @@ - Fixed a bug in GD's truecolor TTF handling. (Derick) - Fixed several 64-bit problems. (Dave) - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe) +- Fixed bug #22775 (Fatal errors exit with status 0 with CGI/CLI). (Jani) - Fixed bug #22751 (Compile error in gdcache.c when external libgd is used). (Jani) - Fixed bug #22721 (Poor file() performance on systems without mmap). (Wez) - Fixed bug #22709 (Crash in interbase when database unavailable). (Vladimir Michl) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended
sniper Wed Mar 19 11:53:02 2003 EDT Modified files: /php4 php.ini-dist php.ini-recommended Log: Using of quotes around paths is a very good idea.. Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.185 php4/php.ini-dist:1.186 --- php4/php.ini-dist:1.185 Sun Mar 16 15:47:56 2003 +++ php4/php.ini-dist Wed Mar 19 11:53:02 2003 @@ -313,7 +313,7 @@ ; leading '/'. You must also specify the file extension being used including ; the dot. ; Note: Never use this feature for production boxes. -;docref_root = /phpmanual/ +;docref_root = /phpmanual/ ;docref_ext = .html ; String to output before an error message. @@ -427,7 +427,7 @@ user_dir = ; Directory in which the loadable extensions (modules) reside. -extension_dir = ./ +extension_dir = ./ ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.131 php4/php.ini-recommended:1.132 --- php4/php.ini-recommended:1.131 Sun Mar 16 15:47:56 2003 +++ php4/php.ini-recommendedWed Mar 19 11:53:02 2003 @@ -328,7 +328,7 @@ ; leading '/'. You must also specify the file extension being used including ; the dot. ; Note: Never use this feature for production boxes. -;docref_root = /phpmanual/ +;docref_root = /phpmanual/ ;docref_ext = .html ; String to output before an error message. @@ -442,7 +442,7 @@ user_dir = ; Directory in which the loadable extensions (modules) reside. -extension_dir = ./ +extension_dir = ./ ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / php.ini-dist php.ini-recommended
sniper Wed Mar 19 11:53:25 2003 EDT Modified files: (Branch: PHP_4_3) /php4 php.ini-dist php.ini-recommended Log: MFH Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.171.2.8 php4/php.ini-dist:1.171.2.9 --- php4/php.ini-dist:1.171.2.8 Fri Mar 14 19:26:43 2003 +++ php4/php.ini-dist Wed Mar 19 11:53:25 2003 @@ -311,7 +311,7 @@ ; and change docref_root to the base URL of your local copy including the ; leading '/'. You must also specify the file extension being used including ; the dot. -;docref_root = /phpmanual/ +;docref_root = /phpmanual/ ;docref_ext = .html ; String to output before an error message. @@ -420,7 +420,7 @@ user_dir = ; Directory in which the loadable extensions (modules) reside. -extension_dir = ./ +extension_dir = ./ ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.119.2.6 php4/php.ini-recommended:1.119.2.7 --- php4/php.ini-recommended:1.119.2.6 Fri Mar 14 19:26:43 2003 +++ php4/php.ini-recommendedWed Mar 19 11:53:25 2003 @@ -326,7 +326,7 @@ ; and change docref_root to the base URL of your local copy including the ; leading '/'. You must also specify the file extension being used including ; the dot. -;docref_root = /phpmanual/ +;docref_root = /phpmanual/ ;docref_ext = .html ; String to output before an error message. @@ -435,7 +435,7 @@ user_dir = ; Directory in which the loadable extensions (modules) reside. -extension_dir = ./ +extension_dir = ./ ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / README.TESTING
ddhill Wed Mar 19 13:04:18 2003 EDT Modified files: /php4 README.TESTING Log: Correcting example to use proper variable - NO_INTERACTION Index: php4/README.TESTING diff -u php4/README.TESTING:1.20 php4/README.TESTING:1.21 --- php4/README.TESTING:1.20Mon Jan 20 10:07:20 2003 +++ php4/README.TESTING Wed Mar 19 13:04:17 2003 @@ -119,7 +119,7 @@ export CC=gcc # Set test environment -export NO_INTERACTIVITY=1 +export NO_INTERACTION=1 export REPORT_EXIT_STATUS=1 cd $CO_DIR -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/cli php_cli.c
helly Wed Mar 19 15:36:04 2003 EDT Modified files: /php4/sapi/cli php_cli.c Log: - reenable $argc/$argv - add a comment where hardcoded defaults would go # i believe we have none for now though Index: php4/sapi/cli/php_cli.c diff -u php4/sapi/cli/php_cli.c:1.73 php4/sapi/cli/php_cli.c:1.74 --- php4/sapi/cli/php_cli.c:1.73Tue Mar 18 15:52:52 2003 +++ php4/sapi/cli/php_cli.c Wed Mar 19 15:36:04 2003 @@ -600,6 +600,8 @@ /* Set some CLI defaults */ SG(options) |= SAPI_OPTION_NO_CHDIR; + /* here is the place for hard coded defaults which cannot be overwritten in the ini file */ + /*zend_alter_ini_entry(name, len, value, 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);*/ zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ @@ -894,6 +896,7 @@ } /* This actually destructs the elements of the list - ugly hack */ + zend_is_auto_global(_SERVER, sizeof(_SERVER)-1 TSRMLS_CC); zend_llist_apply(global_vars, (llist_apply_func_t) php_register_command_line_global_vars TSRMLS_CC); zend_llist_destroy(global_vars); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/tokenizer tokenizer.c
sniper Wed Mar 19 18:08:58 2003 EDT Modified files: /php4/ext/tokenizer tokenizer.c Log: Andrei forgot this.. Index: php4/ext/tokenizer/tokenizer.c diff -u php4/ext/tokenizer/tokenizer.c:1.15 php4/ext/tokenizer/tokenizer.c:1.16 --- php4/ext/tokenizer/tokenizer.c:1.15 Fri Mar 7 00:15:25 2003 +++ php4/ext/tokenizer/tokenizer.c Wed Mar 19 18:08:58 2003 @@ -259,7 +259,6 @@ REGISTER_LONG_CONSTANT(T_LINE, T_LINE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_FILE, T_FILE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_COMMENT, T_COMMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT(T_ML_COMMENT, T_ML_COMMENT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_OPEN_TAG, T_OPEN_TAG, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_OPEN_TAG_WITH_ECHO, T_OPEN_TAG_WITH_ECHO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_CLOSE_TAG, T_CLOSE_TAG, CONST_CS | CONST_PERSISTENT); @@ -472,7 +471,6 @@ case T_LINE: return T_LINE; case T_FILE: return T_FILE; case T_COMMENT: return T_COMMENT; - case T_ML_COMMENT: return T_ML_COMMENT; case T_OPEN_TAG: return T_OPEN_TAG; case T_OPEN_TAG_WITH_ECHO: return T_OPEN_TAG_WITH_ECHO; case T_CLOSE_TAG: return T_CLOSE_TAG; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/tokenizer tokenizer.c
sniper Wed Mar 19 18:10:27 2003 EDT Modified files: /php4/ext/tokenizer tokenizer.c Log: And this too.. Index: php4/ext/tokenizer/tokenizer.c diff -u php4/ext/tokenizer/tokenizer.c:1.16 php4/ext/tokenizer/tokenizer.c:1.17 --- php4/ext/tokenizer/tokenizer.c:1.16 Wed Mar 19 18:08:58 2003 +++ php4/ext/tokenizer/tokenizer.c Wed Mar 19 18:10:27 2003 @@ -259,6 +259,7 @@ REGISTER_LONG_CONSTANT(T_LINE, T_LINE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_FILE, T_FILE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_COMMENT, T_COMMENT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(T_DOC_COMMENT, T_DOC_COMMENT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_OPEN_TAG, T_OPEN_TAG, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_OPEN_TAG_WITH_ECHO, T_OPEN_TAG_WITH_ECHO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(T_CLOSE_TAG, T_CLOSE_TAG, CONST_CS | CONST_PERSISTENT); @@ -481,6 +482,7 @@ case T_CURLY_OPEN: return T_CURLY_OPEN; case T_PAAMAYIM_NEKUDOTAYIM: return T_DOUBLE_COLON; #ifdef ZEND_ENGINE_2 + case T_DOC_COMMENT: return T_DOC_COMMENT; case T_ABSTRACT: return T_ABSTRACT; case T_CATCH: return T_CATCH; case T_FINAL: return T_FINAL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/bcmath bcmath.c
sniper Wed Mar 19 19:22:57 2003 EDT Modified files: /php4/ext/bcmathbcmath.c Log: WS CS fixes Index: php4/ext/bcmath/bcmath.c diff -u php4/ext/bcmath/bcmath.c:1.51 php4/ext/bcmath/bcmath.c:1.52 --- php4/ext/bcmath/bcmath.c:1.51 Thu Feb 6 17:18:41 2003 +++ php4/ext/bcmath/bcmath.cWed Mar 19 19:22:57 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: bcmath.c,v 1.51 2003/02/06 22:18:41 pollita Exp $ */ +/* $Id: bcmath.c,v 1.52 2003/03/20 00:22:57 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -94,8 +94,8 @@ PHP_RINIT_FUNCTION(bcmath) { - if (cfg_get_long(bcmath.scale, bc_precision)==FAILURE) { - bc_precision=0; + if (cfg_get_long(bcmath.scale, bc_precision) == FAILURE) { + bc_precision = 0; } bc_init_numbers(TSRMLS_C); @@ -130,20 +130,20 @@ Returns the sum of two arbitrary precision numbers */ PHP_FUNCTION(bcadd) { - pval **left, **right, **scale_param; + zval **left, **right, **scale_param; bc_num first, second, result; - int scale=bc_precision; + int scale = bc_precision; switch (ZEND_NUM_ARGS()) { case 2: if (zend_get_parameters_ex(2, left, right) == FAILURE) { - WRONG_PARAM_COUNT; - } + WRONG_PARAM_COUNT; + } break; case 3: if (zend_get_parameters_ex(3, left, right, scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } + WRONG_PARAM_COUNT; + } convert_to_long_ex(scale_param); scale = (int) Z_LVAL_PP(scale_param); break; @@ -159,8 +159,9 @@ php_str2num(first, Z_STRVAL_PP(left) TSRMLS_CC); php_str2num(second, Z_STRVAL_PP(right) TSRMLS_CC); bc_add (first, second, result, scale); - if (result-n_scale scale) + if (result-n_scale scale) { result-n_scale = scale; + } Z_STRVAL_P(return_value) = bc_num2str(result); Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); Z_TYPE_P(return_value) = IS_STRING; @@ -175,20 +176,20 @@ Returns the difference between two arbitrary precision numbers */ PHP_FUNCTION(bcsub) { - pval **left, **right, **scale_param; + zval **left, **right, **scale_param; bc_num first, second, result; - int scale=bc_precision; + int scale = bc_precision; switch (ZEND_NUM_ARGS()) { case 2: if (zend_get_parameters_ex(2, left, right) == FAILURE) { - WRONG_PARAM_COUNT; - } + WRONG_PARAM_COUNT; + } break; case 3: if (zend_get_parameters_ex(3, left, right, scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } + WRONG_PARAM_COUNT; + } convert_to_long_ex(scale_param); scale = (int) Z_LVAL_PP(scale_param); break; @@ -204,8 +205,9 @@ php_str2num(first, Z_STRVAL_PP(left) TSRMLS_CC); php_str2num(second, Z_STRVAL_PP(right) TSRMLS_CC); bc_sub (first, second, result, scale); - if (result-n_scale scale) + if (result-n_scale scale) { result-n_scale = scale; + } Z_STRVAL_P(return_value) = bc_num2str(result); Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); Z_TYPE_P(return_value) = IS_STRING; @@ -220,20 +222,20 @@ Returns the multiplication of two arbitrary precision numbers */ PHP_FUNCTION(bcmul) { - pval **left, **right, **scale_param; + zval **left, **right, **scale_param; bc_num first, second, result; - int scale=bc_precision; + int scale = bc_precision; switch (ZEND_NUM_ARGS()) { case 2: if (zend_get_parameters_ex(2, left, right) == FAILURE) { - WRONG_PARAM_COUNT; - } + WRONG_PARAM_COUNT; + } break; case 3: if (zend_get_parameters_ex(3, left, right, scale_param) == FAILURE) { - WRONG_PARAM_COUNT; -
[PHP-CVS] cvs: php4 /ext/dio dio.c
sniper Wed Mar 19 19:37:10 2003 EDT Modified files: /php4/ext/dio dio.c Log: WS CS fixes Index: php4/ext/dio/dio.c diff -u php4/ext/dio/dio.c:1.26 php4/ext/dio/dio.c:1.27 --- php4/ext/dio/dio.c:1.26 Thu Mar 6 18:07:22 2003 +++ php4/ext/dio/dio.c Wed Mar 19 19:37:10 2003 @@ -43,11 +43,10 @@ PHP_FE(dio_read, NULL) PHP_FE(dio_write, NULL) PHP_FE(dio_close, NULL) -PHP_FE(dio_tcsetattr, NULL) + PHP_FE(dio_tcsetattr, NULL) {NULL, NULL, NULL} }; - zend_module_entry dio_module_entry = { STANDARD_MODULE_HEADER, dio, @@ -61,12 +60,10 @@ STANDARD_MODULE_PROPERTIES }; - #ifdef COMPILE_DL_DIO ZEND_GET_MODULE(dio) #endif - static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC) { php_fd_t *f = (php_fd_t *) rsrc-ptr; @@ -75,7 +72,6 @@ } #define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT) - #define DIO_UNDEF_CONST -1 PHP_MINIT_FUNCTION(dio) @@ -183,6 +179,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, r_fd, bytes) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); data = emalloc(bytes + 1); @@ -213,6 +210,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|l, r_fd, data, data_len, trunc_len) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); res = write(f-fd, data, trunc_len ? trunc_len : data_len); @@ -235,6 +233,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, r_fd, offset) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); if (ftruncate(f-fd, offset) == -1) { @@ -259,6 +258,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, r_fd) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); if (fstat(f-fd, s) == -1) { @@ -295,6 +295,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|l, r_fd, offset, whence) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); RETURN_LONG(lseek(f-fd, offset, whence)); @@ -313,99 +314,95 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|z, r_fd, cmd, arg) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(f, php_fd_t *, r_fd, -1, le_fd_name, le_fd); switch (cmd) { - case F_SETLK: - case F_SETLKW: { - zval **element; - struct flocklk = {0}; - HashTable *fh; - - if (!arg) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, expects argument 3 to be array or int, none given); - RETURN_FALSE; - } - if (Z_TYPE_P(arg) == IS_ARRAY) { - fh = HASH_OF(arg); - if (zend_hash_find(fh, start, sizeof(start), (void **) element) == FAILURE) { - lk.l_start = 0; - } - else { - lk.l_start = Z_LVAL_PP(element); - } - - if (zend_hash_find(fh, length, sizeof(length), (void **) element) == FAILURE) { - lk.l_len = 0; + case F_SETLK: + case F_SETLKW: { + zval **element; + struct flocklk = {0}; + HashTable *fh; + + if (!arg) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, expects argument 3 to be array or int, none given); + RETURN_FALSE; } - else { - lk.l_len = Z_LVAL_PP(element); + if (Z_TYPE_P(arg) == IS_ARRAY) { + fh = HASH_OF(arg); + if (zend_hash_find(fh, start, sizeof(start), (void **) element) == FAILURE) { + lk.l_start = 0; + } else { + lk.l_start = Z_LVAL_PP(element); + } + + if (zend_hash_find(fh, length, sizeof(length), (void **) element) == FAILURE) { + lk.l_len = 0; + } else { + lk.l_len = Z_LVAL_PP(element); + } + + if (zend_hash_find(fh, whence, sizeof(whence), (void **) element) == FAILURE) { +
[PHP-CVS] cvs: php4(PHP_4_3) /main streams.c
wez Wed Mar 19 19:55:59 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main streams.c Log: Fix for persistent stream shutdown in debug builds. Index: php4/main/streams.c diff -u php4/main/streams.c:1.125.2.47 php4/main/streams.c:1.125.2.48 --- php4/main/streams.c:1.125.2.47 Wed Mar 19 14:27:52 2003 +++ php4/main/streams.c Wed Mar 19 19:55:58 2003 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: streams.c,v 1.125.2.47 2003/03/19 19:27:52 wez Exp $ */ +/* $Id: streams.c,v 1.125.2.48 2003/03/20 00:55:58 wez Exp $ */ #define _GNU_SOURCE #include php.h @@ -366,15 +366,22 @@ char leakbuf[512]; snprintf(leakbuf, sizeof(leakbuf), __FILE__ (%d) : Stream of type '%s' 0x%08X (path:%s) was not closed\n, __LINE__, stream-ops-label, (unsigned int)stream, stream-__orig_path); - STR_FREE(stream-__orig_path); - + if (stream-__orig_path) { + pefree(stream-__orig_path, stream-is_persistent); + stream-__orig_path = NULL; + } + # if defined(PHP_WIN32) OutputDebugString(leakbuf); # else fprintf(stderr, %s, leakbuf); # endif } else { - STR_FREE(stream-__orig_path); + if (stream-__orig_path) { + pefree(stream-__orig_path, stream-is_persistent); + stream-__orig_path = NULL; + } + pefree(stream, stream-is_persistent); } #else @@ -2532,6 +2539,7 @@ php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; char *path_to_open; + int persistent = options STREAM_OPEN_PERSISTENT; #if ZEND_DEBUG char *copy_of_path = NULL; #endif @@ -2572,7 +2580,7 @@ #if ZEND_DEBUG if (stream) { - copy_of_path = estrdup(path); + copy_of_path = pestrdup(path, persistent); stream-__orig_path = copy_of_path; } #endif @@ -2587,7 +2595,7 @@ return stream; case PHP_STREAM_RELEASED: #if ZEND_DEBUG - newstream-__orig_path = estrdup(path); + newstream-__orig_path = pestrdup(path, persistent); #endif return newstream; default: @@ -2620,7 +2628,7 @@ tidy_wrapper_error_log(wrapper TSRMLS_CC); #if ZEND_DEBUG if (stream == NULL copy_of_path != NULL) { - efree(copy_of_path); + pefree(copy_of_path, persistent); } #endif return stream; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/domxml php_domxml.c
sniper Wed Mar 19 20:27:40 2003 EDT Modified files: /php4/ext/domxmlphp_domxml.c Log: WS CS fixes.. Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.239 php4/ext/domxml/php_domxml.c:1.240 --- php4/ext/domxml/php_domxml.c:1.239 Thu Mar 6 18:07:23 2003 +++ php4/ext/domxml/php_domxml.cWed Mar 19 20:27:40 2003 @@ -16,20 +16,18 @@ +--+ */ -/* $Id: php_domxml.c,v 1.239 2003/03/06 23:07:23 ddhill Exp $ */ +/* $Id: php_domxml.c,v 1.240 2003/03/20 01:27:40 sniper Exp $ */ /* TODO * - Support Notation Nodes * */ - #ifdef HAVE_CONFIG_H #include config.h #endif #include php.h #include ext/standard/php_rand.h - #include php_domxml.h #if HAVE_DOMXML @@ -38,7 +36,6 @@ #define PHP_XPTR 2 /* General macros used by domxml */ - #define DOMXML_IS_TYPE(zval, ce) (zval Z_TYPE_P(zval) == IS_OBJECT Z_OBJCE_P(zval)-refcount == ce-refcount) #define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret, zval TSRMLS_CC))) { \ @@ -163,7 +160,6 @@ static int le_domxmlentityrefp; /*static int le_domxmlnsp;*/ - #if HAVE_DOMXSLT static int le_domxsltstylesheetp; #endif @@ -200,7 +196,6 @@ zend_class_entry *domxsltstylesheet_class_entry; #endif - static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC); static int node_children(zval **children, xmlNode *nodep TSRMLS_DC); @@ -211,16 +206,16 @@ static zend_function_entry domxml_functions[] = { PHP_FE(domxml_version, NULL) PHP_FE(xmldoc, third_args_force_ref) - PHP_FALIAS(domxml_open_mem, xmldoc, third_args_force_ref) - PHP_FE(xmldocfile, third_args_force_ref) - PHP_FALIAS(domxml_open_file,xmldocfile, third_args_force_ref) + PHP_FALIAS(domxml_open_mem, xmldoc, third_args_force_ref) + PHP_FE(xmldocfile, third_args_force_ref) + PHP_FALIAS(domxml_open_file, xmldocfile, third_args_force_ref) #if defined(LIBXML_HTML_ENABLED) PHP_FE(html_doc, NULL) PHP_FE(html_doc_file, NULL) #endif - PHP_FE(domxml_xmltree, NULL) - PHP_FALIAS(xmltree, domxml_xmltree, NULL) - PHP_FE(domxml_substitute_entities_default, NULL) + PHP_FE(domxml_xmltree, NULL) + PHP_FALIAS(xmltree, domxml_xmltree, NULL) + PHP_FE(domxml_substitute_entities_default, NULL) PHP_FE(domxml_doc_document_element, NULL) PHP_FE(domxml_doc_add_root, NULL) PHP_FE(domxml_doc_set_root, NULL) @@ -243,7 +238,7 @@ PHP_FE(domxml_node_add_namespace, NULL) PHP_FE(domxml_node_set_namespace, NULL) PHP_FE(domxml_new_xmldoc, NULL) - PHP_FALIAS(domxml_new_doc, domxml_new_xmldoc, NULL) + PHP_FALIAS(domxml_new_doc, domxml_new_xmldoc, NULL) PHP_FE(domxml_parser, NULL) PHP_FE(domxml_parser_add_chunk, NULL)