Removed unnecessary copying

This commit is contained in:
Dmitry Stogov 2006-04-07 12:39:43 +00:00
parent ead7652457
commit 8c40d605e4

View File

@ -433,7 +433,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
{
if (!FCGX_IsCGI()) {
FCGX_Request *request = (FCGX_Request *) SG(server_context);
char **env, *p, *t;
char **env, *p;
int magic_quotes_gpc = PG(magic_quotes_gpc);
/* turn off magic_quotes while importing environment variables */
@ -443,9 +443,9 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
if (!p) { /* malformed entry? */
continue;
}
t = estrndup(*env, p - *env);
php_register_variable(t, p + 1, array_ptr TSRMLS_CC);
efree(t);
*p = 0;
php_register_variable(*env, p + 1, array_ptr TSRMLS_CC);
*p = '=';
}
PG(magic_quotes_gpc) = magic_quotes_gpc;
}