Commit 6fb62dd1 authored by Christophe Massiot's avatar Christophe Massiot

* modules/control/http/http.c: Fixed argv[1] in CGI mode.

parent ae029eca
...@@ -618,7 +618,7 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args, ...@@ -618,7 +618,7 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args,
char sep; char sep;
int i_buffer; int i_buffer;
char *p_buffer; char *p_buffer;
char *psz_cwd; char *psz_cwd, *psz_file = NULL;
int i_ret; int i_ret;
#ifdef WIN32 #ifdef WIN32
...@@ -731,16 +731,16 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args, ...@@ -731,16 +731,16 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args,
} }
} }
p = strrchr( p_args->file.file, sep ); psz_file = strrchr( p_args->file.file, sep );
if( p != NULL ) if( psz_file != NULL )
{ {
p++; psz_file++;
psz_tmp = malloc( sizeof("SCRIPT_FILENAME=") + strlen(p) ); psz_tmp = malloc( sizeof("SCRIPT_FILENAME=") + strlen(psz_file) );
sprintf( psz_tmp, "SCRIPT_FILENAME=%s", p ); sprintf( psz_tmp, "SCRIPT_FILENAME=%s", psz_file );
TAB_APPEND( i_env, ppsz_env, psz_tmp ); TAB_APPEND( i_env, ppsz_env, psz_tmp );
TAB_APPEND( p_args->p_association->i_argc, TAB_APPEND( p_args->p_association->i_argc,
p_args->p_association->ppsz_argv, p ); p_args->p_association->ppsz_argv, psz_file );
} }
TAB_APPEND( i_env, ppsz_env, NULL ); TAB_APPEND( i_env, ppsz_env, NULL );
...@@ -767,7 +767,7 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args, ...@@ -767,7 +767,7 @@ int E_(HandlerCallback)( httpd_handler_sys_t *p_args,
TAB_REMOVE( p_args->p_association->i_argc, p_args->p_association->ppsz_argv, TAB_REMOVE( p_args->p_association->i_argc, p_args->p_association->ppsz_argv,
NULL ); NULL );
TAB_REMOVE( p_args->p_association->i_argc, p_args->p_association->ppsz_argv, TAB_REMOVE( p_args->p_association->i_argc, p_args->p_association->ppsz_argv,
p_args->file.file ); psz_file );
if( psz_cwd != NULL ) if( psz_cwd != NULL )
free( psz_cwd ); free( psz_cwd );
while( i_env ) while( i_env )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment