Changeset 9689 for trunk/libtransmission/torrent.c
- Timestamp:
- Dec 9, 2009, 3:00:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r9681 r9689 2317 2317 2318 2318 static void 2319 deleteLocalFile( const char * filename, tr_fileFunc fileFunc ) 2320 { 2321 struct stat sb; 2322 if( !stat( filename, &sb ) ) /* if file exists... */ 2323 fileFunc( filename ); 2324 } 2325 2326 static void 2319 2327 deleteLocalData( tr_torrent * tor, tr_fileFunc fileFunc ) 2320 2328 { … … 2345 2353 for( i=0; i<n; ++i ) 2346 2354 if( tr_ptrArrayFindSorted( &dirtyFolders, s[i], vstrcmp ) == NULL ) 2347 fileFunc( s[i]);2355 deleteLocalFile( s[i], fileFunc ); 2348 2356 2349 2357 /* now blow away any remaining torrent files, such as torrent files in dirty folders */ 2350 2358 for( f=0; f<tor->info.fileCount; ++f ) { 2351 2359 char * path = tr_buildPath( tor->currentDir, tor->info.files[f].name, NULL ); 2352 fileFunc( path);2360 deleteLocalFile( path, fileFunc ); 2353 2361 tr_free( path ); 2354 2362 } … … 2367 2375 #ifdef SYS_DARWIN 2368 2376 char * dsStore = tr_buildPath( s[i], ".DS_Store", NULL ); 2369 fileFunc( dsStore);2377 deleteLocalFile( dsStore, fileFunc ); 2370 2378 tr_free( dsStore ); 2371 2379 #endif 2372 fileFunc( s[i]);2380 deleteLocalFile( s[i], fileFunc ); 2373 2381 } 2374 2382 tr_ptrArrayDestruct( &cleanFolders, NULL ); … … 2404 2412 /* torrent only has one file */ 2405 2413 char * path = tr_buildPath( tor->currentDir, tor->info.files[0].name, NULL ); 2406 fileFunc( path);2414 deleteLocalFile( path, fileFunc ); 2407 2415 tr_free( path ); 2408 2416 2409 2417 tmp = tr_torrentBuildPartial( tor, 0 ); 2410 2418 path = tr_buildPath( tor->currentDir, tmp, NULL ); 2411 fileFunc( path);2419 deleteLocalFile( path, fileFunc ); 2412 2420 tr_free( path ); 2413 2421 tr_free( tmp );
Note: See TracChangeset
for help on using the changeset viewer.