Do the same stupid thing Apple does (return NO), rather than the stupid thing we were doing (segfault), when passing a proxy as the argument to [NSString isEqualToString:] (which is called by [NSConstantString isEqualToString:] when the argument is a proxy).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31003 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2010-07-19 14:59:15 +00:00
parent c86696f8f7
commit 3f1a92959d

View file

@ -2179,6 +2179,13 @@ handle_printf_atsign (FILE *stream,
{
if ([self hash] != [aString hash])
return NO;
// Note: This is entirely wrong, stupid, and breaks the spirit of
// Objective-C. Unfortunately, it's What Apple Does, so we are stuck with
// it.
if ([aString isProxy] || ![aString isKindOfClass: [self class]])
return NO;
if (strCompNsNs(self, aString, 0, (NSRange){0, [self length]})
== NSOrderedSame)
return YES;