]> granicus.if.org Git - transmission/commitdiff
(trunk libT) improve the is_same_file() test in deleteLocalData() to handle nonexiste...
authorJordan Lee <jordan@transmissionbt.com>
Sat, 20 Aug 2011 18:41:45 +0000 (18:41 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 20 Aug 2011 18:41:45 +0000 (18:41 +0000)
libtransmission/torrent.c

index a17daa243103fefaafc1bf43cc58819ef5b41fa1..2c1c83c0e4db5bd59adbbb833928671b8c47abc6 100644 (file)
@@ -2838,11 +2838,10 @@ deleteLocalData( tr_torrent * tor, tr_fileFunc func )
         filename = tr_buildPath( top, tor->info.files[f].name, NULL );
         dir = tr_dirname( filename );
         tr_free( filename );
-
-        if( !tr_is_same_file( top, dir ) ) {
+        if( !tr_is_same_file( top, dir ) && strcmp( top, dir ) ) {
             for( ;; ) {
                 char * parent = tr_dirname( dir );
-                if( tr_is_same_file( top, parent ) ) {
+                if( tr_is_same_file( top, parent ) || !strcmp( top, parent ) ) {
                     if( tr_ptrArrayFindSorted( &folders, dir, vstrcmp ) == NULL ) {
                         tr_ptrArrayInsertSorted( &folders, tr_strdup( dir ), vstrcmp );
                     }