mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
String fixes from stevo.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2685 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5c9a97f30d
commit
65b4ee42ff
17 changed files with 651 additions and 142 deletions
|
@ -49,11 +49,11 @@
|
|||
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. */
|
||||
[super init];
|
||||
_count = length;
|
||||
_contents_chars = byteString;
|
||||
_free_contents = flag;
|
||||
[super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -271,12 +271,12 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
|||
/* xxx Should capacity include the '\0' terminator? */
|
||||
- initWithCapacity: (unsigned)capacity
|
||||
{
|
||||
[super init];
|
||||
_count = 0;
|
||||
_capacity = MAX(capacity, 2);
|
||||
OBJC_MALLOC(_contents_chars, char, _capacity);
|
||||
_contents_chars[0] = '\0';
|
||||
_free_contents = YES;
|
||||
[super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -352,11 +352,11 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
|||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{
|
||||
[super init];
|
||||
_count = length;
|
||||
_capacity = length+1;
|
||||
_contents_chars = byteString;
|
||||
_free_contents = flag;
|
||||
[super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue