mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-11 14:55:41 +00:00
Fixes from previous string fix
This commit is contained in:
parent
dff52ad197
commit
c0273cfb39
@ -92,7 +92,7 @@ NSDate* NSDateFromPlistString(NSString* string)
|
||||
NSLog(@"%@: failed to allocate buffer of size %d", NSStringFromSelector(_cmd), length);
|
||||
return nil;
|
||||
}
|
||||
unichar *result = NSZoneMalloc(NULL, sizeof(uint8_t)*length);
|
||||
uint8_t *result = NSZoneMalloc(NULL, sizeof(uint8_t)*length);
|
||||
if (result == NULL) {
|
||||
NSLog(@"%@: failed to allocate buffer of size %d", NSStringFromSelector(_cmd), length);
|
||||
NSZoneFree(NULL, buffer);
|
||||
|
@ -858,16 +858,16 @@ static inline void reverseString(unichar *buf, NSUInteger len) {
|
||||
U+000D (\r or CR), U+2028 (Unicode line separator), U+000A (\n or LF)
|
||||
U+2029 (Unicode paragraph separator), \r\n, in that order (also known as CRLF)
|
||||
*/
|
||||
unichar prevChar = [self characterAtIndex:start];
|
||||
unichar nextChar = start<length?[self characterAtIndex:start]:0;
|
||||
for(;start!=0;start--) {
|
||||
unichar check=[self characterAtIndex:start-1];
|
||||
|
||||
if(check==0x2028 || check==0x000A || check==0x2029)
|
||||
break;
|
||||
|
||||
if(check==0x000D && prevChar!=0x000A)
|
||||
if(check==0x000D && nextChar!=0x000A)
|
||||
break;
|
||||
prevChar = check;
|
||||
nextChar = check;
|
||||
}
|
||||
|
||||
for(;end<length && state!=done;end++){
|
||||
|
Loading…
x
Reference in New Issue
Block a user