Changeset 8720


Ignore:
Timestamp:
Jun 20, 2009, 12:39:30 AM (13 years ago)
Author:
charles
Message:

(trunk libtransmission) #2227: tr_metaInfoBuilderCreate(topFile) creates invalid .torrent files when topFile ends with a '/'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r8588 r8720  
    297297{
    298298    const char * pch, *prev;
    299     const size_t topLen = strlen( topFile ) + 1; /* +1 for '/' */
     299    size_t       topLen;
    300300    int          n;
    301301
     
    303303    tr_bencInitInt( uninitialized_length, file->size );
    304304
    305     /* the path list */
     305    /* how much of file->filename to walk past */
     306    topLen = strlen( topFile );
     307    if( topLen>0 && topFile[topLen-1]!=TR_PATH_DELIMITER )
     308        ++topLen; /* +1 for the path delimiter */
     309
     310    /* build the path list */
    306311    n = 1;
    307312    for( pch = file->filename + topLen; *pch; ++pch )
Note: See TracChangeset for help on using the changeset viewer.