1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

push the destination directory into tr_torrentInit*()

This commit is contained in:
Charles Kerr 2007-06-26 20:29:13 +00:00
parent 7e09d157cd
commit 40ee651158

View file

@ -497,19 +497,23 @@ opentor( const char * path, const char * hash, uint8_t * data, size_t size,
return NULL;
}
if( dir == NULL )
dir = gl_dir;
if( NULL != path )
{
tor->tor = tr_torrentInit( gl_handle, path, tor->hash,
tor->tor = tr_torrentInit( gl_handle, path, dir,
tor->hash,
TR_FLAG_SAVE, &errcode );
}
else if( NULL != hash )
{
tor->tor = tr_torrentInitSaved( gl_handle, hash, 0, &errcode );
tor->tor = tr_torrentInitSaved( gl_handle, hash, dir, 0, &errcode );
}
else
{
tor->tor = tr_torrentInitData( gl_handle, data, size, tor->hash,
TR_FLAG_SAVE, &errcode );
tor->tor = tr_torrentInitData( gl_handle, data, size, dir,
tor->hash, TR_FLAG_SAVE, &errcode );
}
if( NULL == tor->tor )
@ -567,8 +571,6 @@ opentor( const char * path, const char * hash, uint8_t * data, size_t size,
inf = tr_torrentInfo( tor->tor );
memcpy( tor->hash, inf->hash, sizeof tor->hash );
tr_torrentSetFolder( tor->tor, ( NULL == dir ? gl_dir : dir ) );
if( TR_FLAG_PRIVATE & inf->flags )
{
tor->pexset = 1;