mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-20 18:32:17 +00:00
fix skipping of the first opening brace in key-value lists
This commit is contained in:
parent
8970a0617d
commit
c0fd3f8df7
1 changed files with 9 additions and 2 deletions
|
@ -188,7 +188,10 @@
|
||||||
NSLog(@"parseArray in: %@", [string substringFromIndex: [scanner scanLocation]]);
|
NSLog(@"parseArray in: %@", [string substringFromIndex: [scanner scanLocation]]);
|
||||||
mArray = [[NSMutableArray alloc] init];
|
mArray = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
[scanner scanString: @"[" intoString: NULL];
|
// we chomp up the first opening [
|
||||||
|
if (![scanner isAtEnd])
|
||||||
|
[scanner scanString: @"[" intoString: NULL];
|
||||||
|
|
||||||
elementEnd = NO;
|
elementEnd = NO;
|
||||||
value = nil;
|
value = nil;
|
||||||
while([scanner isAtEnd] == NO && elementEnd == NO)
|
while([scanner isAtEnd] == NO && elementEnd == NO)
|
||||||
|
@ -199,7 +202,6 @@
|
||||||
}
|
}
|
||||||
else if ([string characterAtIndex:[scanner scanLocation]] == '{')
|
else if ([string characterAtIndex:[scanner scanLocation]] == '{')
|
||||||
{
|
{
|
||||||
[scanner scanString: @"{" intoString: NULL];
|
|
||||||
value = [self parseKeyValue: scanner];
|
value = [self parseKeyValue: scanner];
|
||||||
}
|
}
|
||||||
else if ([string characterAtIndex:[scanner scanLocation]] == ']')
|
else if ([string characterAtIndex:[scanner scanLocation]] == ']')
|
||||||
|
@ -239,6 +241,11 @@
|
||||||
|
|
||||||
value = nil;
|
value = nil;
|
||||||
elementEnd = NO;
|
elementEnd = NO;
|
||||||
|
|
||||||
|
// we chomp up the first opening { which may not be always present
|
||||||
|
if (![scanner isAtEnd])
|
||||||
|
[scanner scanString: @"{" intoString: NULL];
|
||||||
|
|
||||||
while([scanner isAtEnd] == NO && elementEnd == NO)
|
while([scanner isAtEnd] == NO && elementEnd == NO)
|
||||||
{
|
{
|
||||||
[scanner scanUpToString: @"=" intoString: &key];
|
[scanner scanUpToString: @"=" intoString: &key];
|
||||||
|
|
Loading…
Reference in a new issue