mirror of
https://github.com/transmission/transmission
synced 2025-02-18 20:30:43 +00:00
(trunk libT) improve the is_same_file() test in deleteLocalData() to handle nonexistent directories too.
This commit is contained in:
parent
2efb69dda3
commit
56e47e96d0
1 changed files with 2 additions and 3 deletions
|
@ -2838,11 +2838,10 @@ deleteLocalData( tr_torrent * tor, tr_fileFunc func )
|
||||||
filename = tr_buildPath( top, tor->info.files[f].name, NULL );
|
filename = tr_buildPath( top, tor->info.files[f].name, NULL );
|
||||||
dir = tr_dirname( filename );
|
dir = tr_dirname( filename );
|
||||||
tr_free( filename );
|
tr_free( filename );
|
||||||
|
if( !tr_is_same_file( top, dir ) && strcmp( top, dir ) ) {
|
||||||
if( !tr_is_same_file( top, dir ) ) {
|
|
||||||
for( ;; ) {
|
for( ;; ) {
|
||||||
char * parent = tr_dirname( dir );
|
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 ) {
|
if( tr_ptrArrayFindSorted( &folders, dir, vstrcmp ) == NULL ) {
|
||||||
tr_ptrArrayInsertSorted( &folders, tr_strdup( dir ), vstrcmp );
|
tr_ptrArrayInsertSorted( &folders, tr_strdup( dir ), vstrcmp );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue