(trunk libT) #3562 ".torrent files are created incorrectly when the content is a single file inside a subdirectory" -- fixed.

This commit is contained in:
Charles Kerr 2010-09-21 16:58:15 +00:00
parent 65b4e28c60
commit 51a61bc1da
1 changed files with 5 additions and 2 deletions

View File

@ -336,12 +336,15 @@ makeInfoDict( tr_benc * dict,
{
uint8_t * pch;
char * base;
const tr_bool single_file_mode = ( builder->fileCount == 1 ) && ( strchr( builder->files[0].filename, '/' ) == NULL );
tr_bencDictReserve( dict, 5 );
if( builder->fileCount == 1 )
if( single_file_mode )
{
tr_bencDictAddInt( dict, "length", builder->files[0].size );
else
}
else /* multiple file mode */
{
uint32_t i;
tr_benc * list = tr_bencDictAddList( dict, "files",