1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

(trunk libT) #1800: Display glitch in "transmission-daemon -l" when all files in a torrent are disabled

This commit is contained in:
Charles Kerr 2009-02-09 17:44:47 +00:00
parent 65bba3fdfb
commit 7026258127

View file

@ -198,7 +198,12 @@ addFiles( tr_benc * args,
}
if( strcmp( arg, "all" ) )
{
tr_rpc_parse_list_str( files, arg, strlen( arg ) );
int i;
int valueCount;
int * values = tr_parseNumberRange( arg, -1, &valueCount );
for( i=0; i<valueCount; ++i )
tr_bencListAddInt( files, values[i] );
tr_free( values );
}
}
@ -1101,6 +1106,12 @@ printTorrentList( tr_benc * top )
char statusStr[64];
char ratioStr[32];
char haveStr[32];
char doneStr[8];
if( sizeWhenDone )
tr_snprintf( doneStr, sizeof( doneStr ), "%d%%", (int)( 100.0 * ( sizeWhenDone - leftUntilDone ) / sizeWhenDone ) );
else
tr_strlcpy( doneStr, "n/a", sizeof( doneStr ) );
strlsize( haveStr, sizeWhenDone - leftUntilDone, sizeof( haveStr ) );
@ -1109,9 +1120,9 @@ printTorrentList( tr_benc * top )
else
tr_snprintf( etaStr, sizeof( etaStr ), "Done" );
printf(
"%4d %3d%% %9s %-8s %6.1f %6.1f %5s %-11s %s\n",
"%4d %4s %9s %-8s %6.1f %6.1f %5s %-11s %s\n",
(int)id,
(int)( 100.0 * ( sizeWhenDone - leftUntilDone ) / sizeWhenDone ),
doneStr,
haveStr,
etaStr,
up / 1024.0,