diff --git a/ChangeLog b/ChangeLog index c48419d26..364de2477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-15 Richard Frith-Macdonald + + * Source/NSBundle.m: + * Source/GSHTTPURLHandle.m: + * Source/NSSortDescriptor.m: + Backport minor fixes from trunk. + 2007-04-13 Richard Frith-Macdonald * Source/GSFileHandle.m: ([-readDataOfLength:]) backport of fix of diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index fce29d1f7..7d9851587 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -1237,23 +1237,23 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) port = @"80"; } + /* An existing socket with keepalive may have been closed by the other + * end. The portable way to detect it is to run the runloop once to + * allow us to be sent a notification about end-of-file. + * On unix systems (google told me it is not reliable on windows) we can + * simply peek on the file descriptor for a much more efficient check. + */ if (sock != nil) { - if (debug) - { - NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd)); - } - /* An existing socket with keepalive may have been closed by the other - * end. The portable way to detect it is to run the runloop once to - * allow us to be sent a notification about end-of-file. - * On unix systems (google told me it is not reliable on windows) we can - * simply peek on the file descriptor for a much more efficient check. - */ #if defined(__MINGW__) NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSRunLoop *loop = [NSRunLoop currentRunLoop]; NSFileHandle *test = RETAIN(sock); + if (debug) + { + NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd)); + } [nc addObserver: self selector: @selector(bgdRead:) name: NSFileHandleReadCompletionNotification @@ -1269,8 +1269,12 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) object: test]; RELEASE(test); #else - int fd = [sock fileDescriptor]; + int fd = [sock fileDescriptor]; + if (debug) + { + NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd)); + } if (fd >= 0) { extern int errno; diff --git a/Source/NSBundle.m b/Source/NSBundle.m index f8ccab2e3..30f5ac113 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1595,11 +1595,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) NSString *path, *fullpath; NSEnumerator* pathlist; - if (!name || [name length] == 0) + if (name == nil) { - [NSException raise: NSInvalidArgumentException - format: @"No resource name specified."]; - /* NOT REACHED */ + name = @""; } pathlist = [[self _bundleResourcePathsWithRootPath: rootPath @@ -1627,7 +1625,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) } } else - fullpath = nil; + { + fullpath = nil; + } } else { diff --git a/Source/NSSortDescriptor.m b/Source/NSSortDescriptor.m index ebd0546ac..7b8d2d4f8 100644 --- a/Source/NSSortDescriptor.m +++ b/Source/NSSortDescriptor.m @@ -308,8 +308,8 @@ SortRange(id *objects, NSRange range, id *descriptors, if (count > 1 && numDescriptors > 0) { id descriptors[numDescriptors]; - GS_BEGINIDBUF(objects, count); NSArray *a; + GS_BEGINIDBUF(objects, count); [self getObjects: objects]; [sortDescriptors getObjects: descriptors];