Merge branch 'master' into fix-nsurlresponse

This commit is contained in:
rfm 2020-03-29 11:30:18 +01:00 committed by GitHub
commit 73baca1056
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 62 deletions

View file

@ -1,12 +1,21 @@
2020-03-12 Frederik Seiffert <frederik@algoriddim.com>
2020-03-29 Frederik Seiffert <frederik@algoriddim.com>
* Source/NSURLResponse.m: Fix parsing of NSURLResponse content type
header.
2020-03-29 Fred Kiefer <fredkiefer@gmx.de>
* Source/NSString.m: Attempt to make calls to GSICUCollatorOpen()
more consistent and correct for ICU 65.
2020-03-26 Frederik Seiffert <frederik@algoriddim.com>
* Headers/Foundation/NSError.h:
* Source/NSError.m: Added NSErrorDomain typedef.
2020-03-12 Fred Kiefer <fredkiefer@gmx.de>
* Source/NSURL.m: Fix compiler warnigns.
* Headers/Foundation/NSLocale.h,
* Source/NSURL.m: Fix compiler warnings.
* Headers/Foundation/NSLocale.h:
* Source/NSLocale.m: Add a few convenience methods from MacOS 10.12.
2020-03-10 Frederik Seiffert <frederik@algoriddim.com>

View file

@ -38,6 +38,8 @@ extern "C" {
@class NSArray, NSDictionary, NSString;
typedef NSString* NSErrorDomain;
/**
* Key for user info dictionary component which describes the error in
* a human readable format.
@ -103,20 +105,20 @@ GS_EXPORT NSString* const NSURLErrorFailingURLStringErrorKey;
/**
* Domain for system errors (on MACH).
*/
GS_EXPORT NSString* const NSMACHErrorDomain;
GS_EXPORT NSErrorDomain const NSMACHErrorDomain;
/**
* Domain for system errors.
*/
GS_EXPORT NSString* const NSOSStatusErrorDomain;
GS_EXPORT NSErrorDomain const NSOSStatusErrorDomain;
/**
* Domain for system and system library errors.
*/
GS_EXPORT NSString* const NSPOSIXErrorDomain;
GS_EXPORT NSErrorDomain const NSPOSIXErrorDomain;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST)
/**
* Domain for Foundation and AppKit (base and gui) errors.
*/
GS_EXPORT NSString* const NSCocoaErrorDomain;
GS_EXPORT NSErrorDomain const NSCocoaErrorDomain;
#endif
/**
@ -150,7 +152,7 @@ GS_EXPORT NSString* const NSCocoaErrorDomain;
* Creates and returns an autoreleased NSError instance by calling
* -initWithDomain:code:userInfo:
*/
+ (id) errorWithDomain: (NSString*)aDomain
+ (id) errorWithDomain: (NSErrorDomain)aDomain
code: (NSInteger)aCode
userInfo: (NSDictionary*)aDictionary;
@ -163,13 +165,13 @@ GS_EXPORT NSString* const NSCocoaErrorDomain;
/**
* Return the domain for this instance.
*/
- (NSString*) domain;
- (NSErrorDomain) domain;
/** <init />
* Initialises the receiver using the supplied domain, code, and info.<br />
* The domain must be non-nil.
*/
- (id) initWithDomain: (NSString*)aDomain
- (id) initWithDomain: (NSErrorDomain)aDomain
code: (NSInteger)aCode
userInfo: (NSDictionary*)aDictionary;

View file

@ -279,14 +279,14 @@ DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id);
*/
#define FOUNDATION_EXPORT GS_EXPORT
#if defined(__cplusplus)
}
#endif
/**
* Declare NSExceptionName
*/
typedef NSString* NSExceptionName;
#if defined(__cplusplus)
}
#endif
/**
* Declare Apple availability macros for compatibility purposes as no-ops.

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);