mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Include <objects/behavior.h.
([NSString -componentsSeparatedByString:]): Initialize ARRAY! git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1212 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
822381a98f
commit
735a988473
1 changed files with 12 additions and 9 deletions
|
@ -41,6 +41,7 @@
|
||||||
#include <objects/IndexedCollection.h>
|
#include <objects/IndexedCollection.h>
|
||||||
#include <objects/IndexedCollectionPrivate.h>
|
#include <objects/IndexedCollectionPrivate.h>
|
||||||
#include <objects/String.h>
|
#include <objects/String.h>
|
||||||
|
#include <objects/behavior.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
@implementation NSString
|
@implementation NSString
|
||||||
|
@ -366,19 +367,21 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
NSRange search;
|
NSRange search;
|
||||||
NSRange found;
|
NSRange found;
|
||||||
NSMutableArray *array;
|
NSMutableArray *array = [NSMutableArray array];
|
||||||
|
|
||||||
search = NSMakeRange(0, [self length]);
|
search = NSMakeRange (0, [self length]);
|
||||||
found = [self rangeOfString:separator];
|
found = [self rangeOfString: separator];
|
||||||
while (found.length)
|
while (found.length)
|
||||||
{
|
{
|
||||||
NSRange current;
|
NSRange current;
|
||||||
current = NSMakeRange(search.location, found.location - search.location);
|
current = NSMakeRange (search.location,
|
||||||
[array addObject:[self substringFromRange:current]];
|
found.location - search.location);
|
||||||
search = NSMakeRange(found.location+1, search.length - found.location);
|
[array addObject: [self substringFromRange: current]];
|
||||||
found = [self rangeOfString:separator
|
search = NSMakeRange (found.location+1,
|
||||||
options:0
|
search.length - found.location);
|
||||||
range:search];
|
found = [self rangeOfString: separator
|
||||||
|
options: 0
|
||||||
|
range: search];
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Need to make mutable array into non-mutable array?
|
// FIXME: Need to make mutable array into non-mutable array?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue