From e053f6c59db82a29193069088e57b2ac4532a6ea Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 20 Feb 2008 11:36:42 +0000 Subject: [PATCH] #714: libT creates invalid torrent files when given makemeta is given a non-absolute pathname --- libtransmission/makemeta.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index a3f5345cb..f99cd0ffa 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -72,7 +72,10 @@ getFiles( const char * dir, { struct FileList * node = tr_new( struct FileList, 1 ); node->size = sb.st_size; - node->filename = tr_strdup( buf ); + if( ( buf[0]=='.' ) && ( buf[1]=='/' ) ) + node->filename = tr_strdup( buf + 2 ); + else + node->filename = tr_strdup( buf ); node->next = list; list = node; }