From 8c7434ddedb9f029993e265305e4319229cc1adb Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 21 Dec 2007 22:38:01 +0000 Subject: [PATCH] fix a different r4267 bug, also reported by John_Clay --- libtransmission/torrent.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 22609bd68..4732ed725 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -451,7 +451,8 @@ tr_torrentParse( const tr_handle * h, int err; tr_ctor * ctor = tr_ctorNew( h ); tr_ctorSetMetainfoFromFile( ctor, path ); - tr_ctorSetDestination( ctor, TR_FORCE, destination ); + if( destination && *destination ) + tr_ctorSetDestination( ctor, TR_FORCE, destination ); err = tr_torrentParseFromCtor( h, ctor, setmeInfo ); tr_ctorFree( ctor ); return err; @@ -468,7 +469,8 @@ tr_torrentInit( tr_handle * h, tr_torrent * tor; tr_ctor * ctor = tr_ctorNew( h ); tr_ctorSetMetainfoFromFile( ctor, path ); - tr_ctorSetDestination( ctor, TR_FORCE, destination ); + if( destination && *destination ) + tr_ctorSetDestination( ctor, TR_FORCE, destination ); tr_ctorSetPaused( ctor, TR_FORCE, isPaused ); tor = tr_torrentNew( h, ctor, setmeError ); tr_ctorFree( ctor ); @@ -485,7 +487,8 @@ tr_torrentParseHash( const tr_handle * h, int err; tr_ctor * ctor = tr_ctorNew( h ); tr_ctorSetMetainfoFromHash( ctor, hashStr ); - tr_ctorSetDestination( ctor, TR_FORCE, destination ); + if( destination && *destination ) + tr_ctorSetDestination( ctor, TR_FORCE, destination ); err = tr_torrentParseFromCtor( h, ctor, setmeInfo ); tr_ctorFree( ctor ); return err; @@ -502,7 +505,8 @@ tr_torrentInitSaved( tr_handle * h, tr_torrent * tor; tr_ctor * ctor = tr_ctorNew( h ); tr_ctorSetMetainfoFromHash( ctor, hashStr ); - tr_ctorSetDestination( ctor, TR_FORCE, destination ); + if( destination && *destination ) + tr_ctorSetDestination( ctor, TR_FORCE, destination ); tr_ctorSetPaused( ctor, TR_FORCE, isPaused ); tor = tr_torrentNew( h, ctor, setmeError ); tr_ctorFree( ctor ); @@ -521,7 +525,8 @@ tr_torrentInitData( tr_handle * h, tr_torrent * tor; tr_ctor * ctor = tr_ctorNew( h ); tr_ctorSetMetainfo( ctor, metainfo, len ); - tr_ctorSetDestination( ctor, TR_FORCE, destination ); + if( destination && *destination ) + tr_ctorSetDestination( ctor, TR_FORCE, destination ); tr_ctorSetPaused( ctor, TR_FORCE, isPaused ); tor = tr_torrentNew( h, ctor, setmeError ); tr_ctorFree( ctor );