(trunk libT) #4127 "Torrent complete script doesn't pass on the environment" -- fixed with patch from geirha.

The fix was to putenv() the new environment variables, then call execvp() instead of execve().
This commit is contained in:
Jordan Lee 2011-03-16 18:11:48 +00:00
parent 374ed10f3b
commit 13514e16a7
1 changed files with 3 additions and 1 deletions

View File

@ -1950,7 +1950,9 @@ torrentCallScript( const tr_torrent * tor, const char * script )
if( !fork( ) )
{
execve( script, cmd, env );
for (i=0; env[i]; ++i)
putenv(env[i]);
execvp( script, cmd );
_exit( 0 );
}
#endif