jani Sun Jul 15 15:21:12 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/main main.c
Log:
MFH: ws fixes (sync!)
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.44&r2=1.640.2.23.2.45&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.44 php-src/main/main.c:1.640.2.23.2.45
--- php-src/main/main.c:1.640.2.23.2.44 Sun Jul 15 14:15:02 2007
+++ php-src/main/main.c Sun Jul 15 15:21:12 2007
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.640.2.23.2.44 2007/07/15 14:15:02 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.45 2007/07/15 15:21:12 jani Exp $ */
/* {{{ includes
*/
@@ -236,7 +236,7 @@
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
- PHP_INI_ENTRY_EX("define_syslog_variables", "0",
PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
+ PHP_INI_ENTRY_EX("define_syslog_variables", "0",
PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR,
PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR,
PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR,
PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
@@ -363,7 +363,7 @@
if (PG(open_basedir) &&
php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) {
return;
}
-
+
fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND |
O_WRONLY, 0644);
if (fd != -1) {
char *tmp;
@@ -412,7 +412,7 @@
ret = PHPWRITE(buffer, size);
efree(buffer);
va_end(args);
-
+
return ret;
}
/* }}} */
@@ -471,8 +471,9 @@
} else if (php_during_module_shutdown()) {
function = "PHP Shutdown";
} else if (EG(current_execute_data) &&
- EG(current_execute_data)->opline &&
- EG(current_execute_data)->opline->opcode ==
ZEND_INCLUDE_OR_EVAL) {
+ EG(current_execute_data)->opline &&
+ EG(current_execute_data)->opline->opcode ==
ZEND_INCLUDE_OR_EVAL
+ ) {
switch
(EG(current_execute_data)->opline->op2.u.constant.value.lval) {
case ZEND_EVAL:
function = "eval";
@@ -508,9 +509,9 @@
/* if we still have memory then format the origin */
if (is_function) {
- origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name,
space, function, params);
+ origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name,
space, function, params);
} else {
- origin_len = spprintf(&origin, 0, "%s", function);
+ origin_len = spprintf(&origin, 0, "%s", function);
}
if (PG(html_errors)) {
@@ -608,7 +609,7 @@
PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const
char *format, ...)
{
va_list args;
-
+
va_start(args, format);
php_verror(docref, "", type, format, args TSRMLS_CC);
va_end(args);
@@ -620,7 +621,7 @@
PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char
*param1, int type, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
php_verror(docref, param1, type, format, args TSRMLS_CC);
va_end(args);
@@ -633,7 +634,7 @@
{
char *params;
va_list args;
-
+
spprintf(¶ms, 0, "%s,%s", param1, param2);
va_start(args, format);
php_verror(docref, params ? params : "...", type, format, args
TSRMLS_CC);
@@ -848,9 +849,10 @@
EG(exit_status) = 255;
if (module_initialized) {
if (!SG(headers_sent) &&
- SG(sapi_headers).http_response_code == 200)
{
+ SG(sapi_headers).http_response_code ==
200
+ ) {
sapi_header_line ctr = {0};
-
+
ctr.line = "HTTP/1.0 500 Internal
Server Error";
ctr.line_len = strlen(ctr.line);
sapi_header_op(SAPI_HEADER_REPLACE,
&ctr TSRMLS_CC);
@@ -919,6 +921,7 @@
}
/* }}} */
+
static void stream_closer_for_zend(void *handle TSRMLS_DC)
{
php_stream_close((php_stream*)handle);
@@ -1122,7 +1125,7 @@
zend_try {
PG(during_request_startup) = 1;
-
+
php_output_activate(TSRMLS_C);
/* initialize global variables */
@@ -1130,7 +1133,7 @@
PG(header_is_being_sent) = 0;
PG(connection_status) = PHP_CONNECTION_NORMAL;
PG(in_user_include) = 0;
-
+
zend_activate(TSRMLS_C);
sapi_activate(TSRMLS_C);
@@ -1175,7 +1178,7 @@
}
# else
int php_request_startup(TSRMLS_D)
-{
+{
int retval = SUCCESS;
#if PHP_SIGCHILD
@@ -1185,7 +1188,7 @@
if (php_start_sapi() == FAILURE) {
return FAILURE;
}
-
+
php_output_activate(TSRMLS_C);
sapi_activate(TSRMLS_C);
php_hash_environment(TSRMLS_C);
@@ -1218,7 +1221,7 @@
if (php_start_sapi(TSRMLS_C) == FAILURE) {
return FAILURE;
}
-
+
php_output_activate(TSRMLS_C);
sapi_activate_headers_only(TSRMLS_C);
php_hash_environment(TSRMLS_C);
@@ -1293,7 +1296,7 @@
TSRMLS_FETCH();
report_memleaks = PG(report_memleaks);
-
+
/* EG(opline_ptr) points into nirvana and therefore cannot be safely
accessed
* inside zend_executor callback functions.
*/
@@ -1304,7 +1307,7 @@
if (PG(modules_activated)) zend_try {
php_call_shutdown_functions(TSRMLS_C);
} zend_end_try();
-
+
/* 2. Call all possible __destruct() functions */
zend_try {
zend_call_destructors(TSRMLS_C);
@@ -1371,7 +1374,7 @@
} zend_end_try();
/* 12. Reset max_execution_time */
- zend_try {
+ zend_try {
zend_unset_timeout(TSRMLS_C);
} zend_end_try();
@@ -1567,7 +1570,7 @@
#endif
EG(bailout) = NULL;
EG(error_reporting) = E_ALL & ~E_NOTICE;
-
+
PG(header_is_being_sent) = 0;
SG(request_info).headers_only = 0;
SG(request_info).argv0 = NULL;
@@ -1626,7 +1629,7 @@
php_printf("PHP: Unable to initialize stream url wrappers.\n");
return FAILURE;
}
-
+
/* initialize registry for images to be used in phpinfo()
(this uses configuration parameters from php.ini)
*/
@@ -1768,7 +1771,7 @@
core_globals_dtor(&core_globals TSRMLS_CC);
#else
zend_ini_global_shutdown(TSRMLS_C);
- ts_free_id(core_globals_id);
+ ts_free_id(core_globals_id);
#endif
php_shutdown_temporary_directory();
@@ -1831,8 +1834,9 @@
* otherwise it will get opened and added to the
included_files list in zend_execute_scripts
*/
if (primary_file->filename &&
- primary_file->opened_path == NULL &&
- primary_file->type != ZEND_HANDLE_FILENAME) {
+ primary_file->opened_path == NULL &&
+ primary_file->type != ZEND_HANDLE_FILENAME
+ ) {
int realfile_len;
int dummy = 1;
@@ -1869,7 +1873,6 @@
zend_set_timeout(INI_INT("max_execution_time"));
}
retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3,
prepend_file_p, primary_file, append_file_p) == SUCCESS);
-
} zend_end_try();
#if HAVE_BROKEN_GETCWD
@@ -1897,7 +1900,7 @@
#define OLD_CWD_SIZE 4096
old_cwd = do_alloca(OLD_CWD_SIZE);
old_cwd[0] = '\0';
-
+
zend_try {
#ifdef PHP_WIN32
UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
@@ -1911,7 +1914,7 @@
}
zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1,
primary_file);
} zend_end_try();
-
+
if (old_cwd[0] != '\0') {
VCWD_CHDIR(old_cwd);
}
@@ -1965,7 +1968,7 @@
} else {
SG(request_info).auth_digest = NULL;
}
-
+
if (ret == -1 && auth && auth[0] != '\0' && strncmp(auth, "Digest ", 7)
== 0) {
SG(request_info).auth_digest = estrdup(auth + 7);
ret = 0;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php