From 4caac7564673beb9bf7b791ff5098b8d976bb6ee Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 28 Sep 2008 16:02:13 +0000 Subject: [PATCH] (libT) #1267: when making new torrents, don't allow 0-byte files --- libtransmission/makemeta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index f8fe7173d..9e0ca8058 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -67,12 +67,11 @@ getFiles( const char * dir, { struct dirent *d; for( d = readdir( odir ); d != NULL; d = readdir( odir ) ) - if( d->d_name && d->d_name[0] != '.' ) /* skip dotfiles, ., and .. - */ + if( d->d_name && d->d_name[0] != '.' ) /* skip dotfiles */ list = getFiles( buf, d->d_name, list ); closedir( odir ); } - else if( S_ISREG( sb.st_mode ) ) + else if( S_ISREG( sb.st_mode ) && ( sb.st_size > 0 ) ) { struct FileList * node = tr_new( struct FileList, 1 ); node->size = sb.st_size;