mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Make more tolerant by accepting nil as input for replacing characters in range.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9053 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
087c35f0f9
commit
11fbedeedf
2 changed files with 17 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-02-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSString.m: permit nil string when replacing characters
|
||||
in range. Treat as an empty string rather than raising exception.
|
||||
|
||||
2001-02-07 Jonathan Gapen <jagapen@home.com>
|
||||
|
||||
* Source/NSFileManager.m: Make disk space report work on FreeBSD.
|
||||
|
|
|
@ -2581,13 +2581,19 @@ transmute(ivars self, NSString *aString)
|
|||
|
||||
GS_RANGE_CHECK(aRange, _count);
|
||||
if (aString == nil)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"replace characters with nil string"];
|
||||
if (GSObjCIsInstance(aString) == NO)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"replace characters with non-string"];
|
||||
{
|
||||
length = 0;
|
||||
}
|
||||
else if (GSObjCIsInstance(aString) == NO)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"replace characters with non-string"];
|
||||
}
|
||||
else
|
||||
{
|
||||
length = (aString == nil) ? 0 : [aString length];
|
||||
}
|
||||
|
||||
length = (aString == nil) ? 0 : [aString length];
|
||||
offset = length - aRange.length;
|
||||
|
||||
if (offset < 0)
|
||||
|
|
Loading…
Reference in a new issue