Author: rfm Date: Wed Oct 5 19:44:00 2016 New Revision: 40125 URL: http://svn.gna.org/viewcvs/gnustep?rev=40125&view=rev Log: Partial fix/update for noncharacter codepoints, also check for task exit more consistently
Modified: libs/base/trunk/ChangeLog libs/base/trunk/Source/Additions/Unicode.m libs/base/trunk/Source/GSString.m libs/base/trunk/Source/NSNotificationQueue.m libs/base/trunk/Source/NSRunLoop.m Modified: libs/base/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=40125&r1=40124&r2=40125&view=diff ============================================================================== --- libs/base/trunk/ChangeLog (original) +++ libs/base/trunk/ChangeLog Wed Oct 5 19:44:00 2016 @@ -1,3 +1,10 @@ +2016-10-05 Richard Frith-Macdonald <r...@gnu.org> + + * Source/Additions/Unicode.m: Permit noncharacter unicode codepoints + * Source/GSString.m: Permit noncharacter unicode codepoints + * Source/NSNotificationQueue.m: Call GSPrivateCheckTasks() + * Source/NSRunLoop.m: Let GSPrivateNotifyASAP() check for task exit. + 2016-09-19 Niels Grewe <niels.gr...@halbordnung.de>> * Source/Additions/GSMime.m (charsetForXml): Modified: libs/base/trunk/Source/Additions/Unicode.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/Unicode.m?rev=40125&r1=40124&r2=40125&view=diff ============================================================================== --- libs/base/trunk/Source/Additions/Unicode.m (original) +++ libs/base/trunk/Source/Additions/Unicode.m Wed Oct 5 19:44:00 2016 @@ -746,11 +746,6 @@ while (i < length) { c = chars[i++]; - if (c == 0xfffe || c == 0xffff - || (c >= 0xfdd0 && c <= 0xfdef)) - { - return i - 1; // Non-characters. - } if (c >= 0xdc00 && c <= 0xdfff) { return i - 1; // Second half of a surrogate pair. @@ -972,16 +967,6 @@ } u = u & ~(0xffffffff << ((5 * sle) + 1)); spos += sle; - - /* - * We discard invalid codepoints here. - */ - if (u > 0x10ffff || u == 0xfffe || u == 0xffff - || (u >= 0xfdd0 && u <= 0xfdef)) - { - result = NO; // Invalid character. - goto done; - } if ((u >= 0xd800) && (u <= 0xdfff)) { @@ -1664,10 +1649,7 @@ } // 0xfeff is a zero-width-no-break-space inside text - if (u1 == 0xfffe // unexpected BOM - || u1 == 0xffff // not a character - || (u1 >= 0xfdd0 && u1 <= 0xfdef) // invalid character - || (u1 >= 0xdc00 && u1 <= 0xdfff)) // bad pairing + if (u1 >= 0xdc00 && u1 <= 0xdfff) // bad pairing { if (strict) { @@ -1786,10 +1768,7 @@ } // 0xfeff is a zero-width-no-break-space inside text - if (u1 == 0xfffe // unexpected BOM - || u1 == 0xffff // not a character - || (u1 >= 0xfdd0 && u1 <= 0xfdef) // invalid character - || (u1 >= 0xdc00 && u1 <= 0xdfff)) // bad pairing + if (u1 >= 0xdc00 && u1 <= 0xdfff) // bad pairing { if (strict) { Modified: libs/base/trunk/Source/GSString.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSString.m?rev=40125&r1=40124&r2=40125&view=diff ============================================================================== --- libs/base/trunk/Source/GSString.m (original) +++ libs/base/trunk/Source/GSString.m Wed Oct 5 19:44:00 2016 @@ -136,8 +136,7 @@ /* * We check for invalid codepoints here. */ - if (u > 0x10ffff || u == 0xfffe || u == 0xffff - || (u >= 0xfdd0 && u <= 0xfdef)) + if (u > 0x10ffff) { [NSException raise: NSInternalInconsistencyException format: @"Codepoint invalid in constant string"]; @@ -261,8 +260,7 @@ /* * We discard invalid codepoints here. */ - if (u > 0x10ffff || u == 0xfffe || u == 0xffff - || (u >= 0xfdd0 && u <= 0xfdef)) + if (u > 0x10ffff) { [NSException raise: NSInvalidArgumentException format: @"invalid unicode codepoint"]; Modified: libs/base/trunk/Source/NSNotificationQueue.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSNotificationQueue.m?rev=40125&r1=40124&r2=40125&view=diff ============================================================================== --- libs/base/trunk/Source/NSNotificationQueue.m (original) +++ libs/base/trunk/Source/NSNotificationQueue.m Wed Oct 5 19:44:00 2016 @@ -643,6 +643,8 @@ { NotificationQueueList *item; + GSPrivateCheckTasks(); + for (item = currentList(); item; item = item->next) { if (item->queue) Modified: libs/base/trunk/Source/NSRunLoop.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSRunLoop.m?rev=40125&r1=40124&r2=40125&view=diff ============================================================================== --- libs/base/trunk/Source/NSRunLoop.m (original) +++ libs/base/trunk/Source/NSRunLoop.m Wed Oct 5 19:44:00 2016 @@ -1176,7 +1176,6 @@ * a method to perform in this thread. */ [GSRunLoopCtxt awakenedBefore: nil]; - GSPrivateCheckTasks(); [self _checkPerformers: context]; GSPrivateNotifyASAP(_currentMode); [_contextStack removeObjectIdenticalTo: context]; @@ -1271,7 +1270,6 @@ /* Process any pending notifications. */ - GSPrivateCheckTasks(); GSPrivateNotifyASAP(mode); /* And process any performers scheduled in the loop (eg something from _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs