mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix for text storage objects setting their content to their own immutable proxy
This commit is contained in:
parent
1170e0c0c1
commit
5ec87d80b4
1 changed files with 4 additions and 2 deletions
|
@ -5401,6 +5401,9 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
* saving and restoring the character which would be
|
||||
* overwritten by the nul, or by getting a character less,
|
||||
* and fetching the last character separately.
|
||||
* NB. There is a possibility that aString may be an immutable
|
||||
* proxy to the receiver, so we must take care to save the
|
||||
* character before making any changes.
|
||||
*/
|
||||
if (aRange.location + length < _count)
|
||||
{
|
||||
|
@ -5415,7 +5418,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
{
|
||||
unsigned int l = length - 1;
|
||||
unsigned int size = 1;
|
||||
unichar u;
|
||||
unichar u = [aString characterAtIndex: l];
|
||||
unsigned char *dst = &_contents.c[aRange.location + l];
|
||||
|
||||
if (l > 0)
|
||||
|
@ -5424,7 +5427,6 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
maxLength: l+1
|
||||
encoding: internalEncoding];
|
||||
}
|
||||
u = [aString characterAtIndex: l];
|
||||
GSFromUnicode(&dst, &size, &u, 1,
|
||||
internalEncoding, 0, GSUniStrict);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue