Merge branch 'master' into fix-pthread-setname

This commit is contained in:
rfm 2020-03-29 11:33:39 +01:00 committed by GitHub
commit da6be9daac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 59 deletions

View file

@ -46,14 +46,14 @@ NSString* const NSRecoveryAttempterErrorKey
NSString* const NSURLErrorFailingURLErrorKey = @"NSErrorFailingURLKey";
NSString* const NSURLErrorFailingURLStringErrorKey = @"NSErrorFailingURLStringKey";
NSString* const NSMACHErrorDomain = @"NSMACHErrorDomain";
NSString* const NSOSStatusErrorDomain = @"NSOSStatusErrorDomain";
NSString* const NSPOSIXErrorDomain = @"NSPOSIXErrorDomain";
NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
NSErrorDomain const NSMACHErrorDomain = @"NSMACHErrorDomain";
NSErrorDomain const NSOSStatusErrorDomain = @"NSOSStatusErrorDomain";
NSErrorDomain const NSPOSIXErrorDomain = @"NSPOSIXErrorDomain";
NSErrorDomain const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
@implementation NSError
+ (id) errorWithDomain: (NSString*)aDomain
+ (id) errorWithDomain: (NSErrorDomain)aDomain
code: (NSInteger)aCode
userInfo: (NSDictionary*)aDictionary
{
@ -88,7 +88,7 @@ NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
return [self localizedDescription];
}
- (NSString*) domain
- (NSErrorDomain) domain
{
return _domain;
}
@ -136,7 +136,7 @@ NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
return self;
}
- (id) initWithDomain: (NSString*)aDomain
- (id) initWithDomain: (NSErrorDomain)aDomain
code: (NSInteger)aCode
userInfo: (NSDictionary*)aDictionary
{

View file

@ -663,28 +663,43 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
{
return NULL;
}
if (locale == nil)
{
/* A nil locale should trigger POSIX collation (i.e. 'A'-'Z' sort
* before 'a'), and support for this was added in ICU 4.6 under the
* locale name en_US_POSIX, but it doesn't fit our requirements
* (e.g. 'e' and 'E' don't compare as equal with case insensitive
* comparison.) - so return NULL to indicate that the GNUstep
* comparison code should be used.
*/
return NULL;
}
else
{
localeCString = [[locale localeIdentifier] UTF8String];
if (localeCString == NULL || strcmp("", localeCString) == 0)
{
return NULL;
}
if (NO == [locale isKindOfClass: [NSLocale class]])
{
if (nil == locale)
{
/* See comments below about the posix locale.
* It's bad for case insensitive search, but needed for numeric
*/
if (mask & NSNumericSearch)
{
locale = [NSLocale systemLocale];
}
else
{
/* A nil locale should trigger POSIX collation (i.e. 'A'-'Z' sort
* before 'a'), and support for this was added in ICU 4.6 under the
* locale name en_US_POSIX, but it doesn't fit our requirements
* (e.g. 'e' and 'E' don't compare as equal with case insensitive
* comparison.) - so return NULL to indicate that the GNUstep
* comparison code should be used.
*/
return NULL;
}
}
else
{
locale = [NSLocale currentLocale];
}
}
localeCString = [[locale localeIdentifier] UTF8String];
if (localeCString != NULL && strcmp("", localeCString) == 0)
{
localeCString = NULL;
}
coll = ucol_open(localeCString, &status);
if (U_SUCCESS(status))
@ -2804,10 +2819,6 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
}
#if GS_USE_ICU == 1
if (nil != locale && NO == [locale isKindOfClass: [NSLocale class]])
{
locale = [NSLocale currentLocale];
}
{
UCollator *coll = GSICUCollatorOpen(mask, locale);
@ -5784,23 +5795,6 @@ static NSFileManager *fm = nil;
[NSException raise: NSInvalidArgumentException format: @"compare with nil"];
#if GS_USE_ICU == 1
if (NO == [locale isKindOfClass: [NSLocale class]])
{
if (nil == locale)
{
/* See comments in GSICUCollatorOpen about the posix locale.
* It's bad for case insensitive search, but needed for numeric
*/
if (mask & NSNumericSearch)
{
locale = [NSLocale systemLocale];
}
}
else
{
locale = [NSLocale currentLocale];
}
}
{
UCollator *coll = GSICUCollatorOpen(mask, locale);

View file

@ -81,7 +81,8 @@ typedef struct {
}
s = [NSScanner scannerWithString: v];
p = [GSMimeParser new];
c = AUTORELEASE([GSMimeHeader new]);
c = AUTORELEASE([[GSMimeHeader alloc] initWithName: @"content-type"
value: nil]);
/* We just set the header body, so we know it will scan and don't need
* to check the retrurn type.
*/