Source/GSString.m

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12827 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Pierre-Yves Rivaille 2002-02-27 15:15:45 +00:00
parent 28181fd527
commit 382ed09b62
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2002-02-27 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
* Source/GSString.m ([GSMutableString -substringWithRange:]):
create a new string which size is the range length, not the original
string's length.
2002-02-27 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gdomap.c: Removed obsolete code for shrinking data structures.

View file

@ -2922,14 +2922,16 @@ transmute(ivars self, NSString *aString)
if (_flags.wide == 1)
{
sub = (NSString*)NSAllocateObject(GSUnicodeInlineStringClass,
_count*sizeof(unichar), NSDefaultMallocZone());
(aRange.length)*sizeof(unichar),
NSDefaultMallocZone());
sub = [sub initWithCharacters: self->_contents.u + aRange.location
length: aRange.length];
}
else
{
sub = (NSString*)NSAllocateObject(GSCInlineStringClass,
_count, NSDefaultMallocZone());
aRange.length,
NSDefaultMallocZone());
sub = [sub initWithCString: self->_contents.c + aRange.location
length: aRange.length];
}