mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Removed unnecessary copying
This commit is contained in:
parent
e5d4bfd637
commit
3ada78d408
1 changed files with 4 additions and 4 deletions
|
@ -412,16 +412,16 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
|
||||||
{
|
{
|
||||||
if (!FCGX_IsCGI()) {
|
if (!FCGX_IsCGI()) {
|
||||||
FCGX_Request *request = (FCGX_Request *) SG(server_context);
|
FCGX_Request *request = (FCGX_Request *) SG(server_context);
|
||||||
char **env, *p, *t;
|
char **env, *p;
|
||||||
|
|
||||||
for (env = request->envp; env != NULL && *env != NULL; env++) {
|
for (env = request->envp; env != NULL && *env != NULL; env++) {
|
||||||
p = strchr(*env, '=');
|
p = strchr(*env, '=');
|
||||||
if (!p) { /* malformed entry? */
|
if (!p) { /* malformed entry? */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
t = estrndup(*env, p - *env);
|
*p = 0;
|
||||||
php_register_variable(t, p + 1, array_ptr TSRMLS_CC);
|
php_register_variable(*env, p + 1, array_ptr TSRMLS_CC);
|
||||||
efree(t);
|
*p = '=';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* call php's original import as a catch-all */
|
/* call php's original import as a catch-all */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue