mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Patched from mail. See ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@627 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d82d74df60
commit
1edc8b38e0
13 changed files with 407 additions and 18 deletions
|
@ -36,12 +36,20 @@
|
|||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{
|
||||
assert(!flag); /* xxx need to make a subclass to handle this. */
|
||||
/* assert(!flag); /* xxx need to make a subclass to handle this. */
|
||||
_count = length;
|
||||
_contents_chars = byteString;
|
||||
_free_contents = flag;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if (_free_contents)
|
||||
OBJC_FREE(_contents_chars);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy,
|
||||
|
@ -61,6 +69,7 @@
|
|||
[aCoder decodeValueOfType:@encode(char*) at:&_contents_chars
|
||||
withName:NULL];
|
||||
_count = strlen(_contents_chars);
|
||||
_free_contents = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -180,6 +189,7 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
|||
_capacity = MAX(capacity, 2);
|
||||
OBJC_MALLOC(_contents_chars, char, _capacity);
|
||||
_contents_chars[0] = '\0';
|
||||
_free_contents = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue