Opened 12 years ago

Closed 12 years ago

#2227 closed Bug (fixed)

transmission-cli: torrent files created with transmissioncli are invalid

Reported by: charles Owned by: charles
Priority: Normal Milestone: 1.73
Component: CLI Version: 1.72
Severity: Major Keywords:


Downstream ticket:

Reported by: François Guerraz <kubrick@…> Date: Fri, 19 Jun 2009 09:54:01 UTC Severity: grave Tags: patch Found in version transmission/1.22-1

When creating a torrent and chosing a directory as a source (-c), file-names in the torrent file are cropped (first character missing) if the directory name ends with a slash, which happen in most of the case because we use bash autocompletion (and it's hard to guess that this final slash is the source of the problem, I had to read the code to understand that!)

This leads to the inability to seed the torrent because the client using the .torrent file cannot find the files it refers to.

I propose the following patch to work around the problem :

--- libtransmission/makemeta.c.old 2009-06-19 11:21:27.000000000 +0200 +++ libtransmission/makemeta.c 2009-06-19 11:21:37.000000000 +0200 @@ -274,7 +274,7 @@

tr_benc * uninitialized_path )


const char *pch, *prev;

  • const size_t topLen = strlen(topFile) + 1; /* +1 for '/' */

+ const size_t topLen = strlen(topFile);

int n;

/* get the file size */

if topFile contains a final slash, it will be taken in account by strlen. So far, this patch seems to cause no side effects neither with -cli nor -gtk.

Change History (2)

comment:1 Changed 12 years ago by charles

  • Owner set to charles
  • Status changed from new to assigned

fixed in trunk in r8720 for 1.73

comment:2 Changed 12 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.