Ignore:
Timestamp:
Jun 7, 2010, 2:25:31 PM (12 years ago)
Author:
charles
Message:

(trunk) #3262 "problems with '.' as the first character in a .torrent's filename" -- fixed in trunk for 2.00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r10710 r10736  
    772772
    773773    return str;
     774}
     775
     776tr_bool
     777tr_str_has_suffix( const char *str, const char *suffix )
     778{
     779    size_t str_len;
     780    size_t suffix_len;
     781
     782    if( !str )
     783        return FALSE;
     784    if( !suffix )
     785        return TRUE;
     786
     787    str_len = strlen( str );
     788    suffix_len = strlen( suffix );
     789    if( str_len < suffix_len )
     790        return FALSE;
     791
     792    return !strncasecmp( str + str_len - suffix_len, suffix, suffix_len );
    774793}
    775794
Note: See TracChangeset for help on using the changeset viewer.