compatibiulity fix for 35699

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34865 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2012-03-02 19:01:30 +00:00
parent ea9c318c42
commit 592f8b39c8
2 changed files with 29 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2012-03-02 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSString.m: Compatribility fix ... copy strings implicitly
when taking a substring of a string whose buffer is not owned.
2012-03-02 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLConnection.m: Compatibility fix for bug #35686

View file

@ -3768,14 +3768,22 @@ agree, create a new GSCInlineString otherwise.
- (NSString*) substringFromRange: (NSRange)aRange
{
GS_RANGE_CHECK(aRange, _count);
return substring_c((GSStr)self, aRange);
if (_flags.owned)
{
GS_RANGE_CHECK(aRange, _count);
return substring_c((GSStr)self, aRange);
}
return [super substringWithRange: aRange];
}
- (NSString*) substringWithRange: (NSRange)aRange
{
GS_RANGE_CHECK(aRange, _count);
return substring_c((GSStr)self, aRange);
if (_flags.owned)
{
GS_RANGE_CHECK(aRange, _count);
return substring_c((GSStr)self, aRange);
}
return [super substringWithRange: aRange];
}
- (id) uppercaseString
@ -4106,14 +4114,22 @@ agree, create a new GSCInlineString otherwise.
- (NSString*) substringFromRange: (NSRange)aRange
{
GS_RANGE_CHECK(aRange, _count);
return substring_u((GSStr)self, aRange);
if (_flags.owned)
{
GS_RANGE_CHECK(aRange, _count);
return substring_u((GSStr)self, aRange);
}
return [super substringWithRange: aRange];
}
- (NSString*) substringWithRange: (NSRange)aRange
{
GS_RANGE_CHECK(aRange, _count);
return substring_u((GSStr)self, aRange);
if (_flags.owned)
{
GS_RANGE_CHECK(aRange, _count);
return substring_u((GSStr)self, aRange);
}
return [super substringWithRange: aRange];
}
- (id) uppercaseString