diff --git a/libtransmission/web.c b/libtransmission/web.c index d958c43d6..39e0e4847 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -516,8 +516,8 @@ tr_http_escape( struct evbuffer * out, for( i = 0; i < len; i++ ) { if( str[i] == ',' || str[i] == '-' || str[i] == '.' || ( '0' <= str[i] && str[i] <= '9' ) - || ( 'a' <= str[i] && str[i] <= 'z' ) || ( 'A' <= str[i] && str[i] <= 'Z' ) + || ( 'a' <= str[i] && str[i] <= 'z' ) || ( str[i] == '/' && !escape_slashes ) ) evbuffer_add( out, &str[i], 1 ); else diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 00078d2e2..5f2e854af 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -1745,9 +1745,10 @@ typedef enum NSIndexSet * selectedIndexes = [fTrackerTable selectedRowIndexes]; BOOL groupSelected = NO; - for (NSUInteger i = 0, trackerIndex = 0; i < [fTrackers count]; ++i) + for (NSUInteger i = 0; i < [fTrackers count]; ++i) { - if ([[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]]) + id object = [fTrackers objectAtIndex: i]; + if ([object isKindOfClass: [NSNumber class]]) { groupSelected = [selectedIndexes containsIndex: i]; if (!groupSelected && i > [selectedIndexes lastIndex]) @@ -1756,13 +1757,10 @@ typedef enum else { if (groupSelected || [selectedIndexes containsIndex: i]) - [removeIdentifiers addIndex: [(TrackerNode *)[fTrackers objectAtIndex: i] identifier]]; - ++trackerIndex; + [removeIdentifiers addIndex: [(TrackerNode *)object identifier]]; } } - NSLog(@"%@", removeIdentifiers); - NSAssert([removeIdentifiers count] > 0, @"Trying to remove no trackers."); if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningRemoveTrackers"]) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 1a59fbb9d..42f08dfea 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -636,7 +636,7 @@ int trashDataFile(const char * filename) trackerStructs[oldTrackerCount].announce = (char *)[tracker UTF8String]; trackerStructs[oldTrackerCount].tier = trackerStructs[oldTrackerCount-1].tier + 1; - trackerStructs[oldTrackerCount].identifier = trackerStructs[oldTrackerCount-1].identifier + 1; + trackerStructs[oldTrackerCount].identifier = oldTrackerCount; const BOOL success = tr_torrentSetAnnounceList(fHandle, trackerStructs, oldTrackerCount+1); tr_free(trackerStructs);