Changeset 8776


Ignore:
Timestamp:
Jul 3, 2009, 2:37:27 PM (13 years ago)
Author:
charles
Message:

(trunk libT) better version of r8775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/metainfo.c

    r8775 r8776  
    6161{
    6262    int i;
    63     const char * tags[] = { "beos", "cli", "daemon", "gtk", "macosx", "wx" };
    64     const int tagCount = 6;
    6563    char * path;
    6664    struct stat sb;
    67 
     65    const int tagCount = 5;
     66    const char * tags[] = { "beos", "cli", "daemon", "macosx", "wx" };
     67
     68    /* test the beos, cli, daemon, macosx, wx tags */
    6869    for( i=0; i<tagCount; ++i ) {
    6970        path = tr_strdup_printf( "%s%c%s-%s", tr_getTorrentDir( session ), '/', inf->hashString, tags[i] );
     
    7374    }
    7475
     76    /* test a non-tagged file */
    7577    path = tr_buildPath( tr_getTorrentDir( session ), inf->hashString, NULL );
    7678    if( !stat( path, &sb ) && ( ( sb.st_mode & S_IFMT ) == S_IFREG ) )
     
    7880    tr_free( path );
    7981
    80     return NULL;
     82    /* return the -gtk form by default, since that's the most common case.
     83       don't bother testing stat() on it since this is the last candidate
     84       and we don't want to return NULL anyway */
     85    return tr_strdup_printf( "%s%c%s-%s", tr_getTorrentDir( session ), '/', inf->hashString, "gtk" );
    8186}
    8287
Note: See TracChangeset for help on using the changeset viewer.