Fix bug in parsing args - a default name without a value should put an empty

string into the defaults dictinary, not attempt to insert a nil object.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3119 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1998-10-26 15:34:57 +00:00
parent 97143ce253
commit 0c5139b3a8

View file

@ -696,13 +696,13 @@ static NSMutableString *processName = nil;
val = [enumerator nextObject]; val = [enumerator nextObject];
if (!val) if (!val)
{ // No more args { // No more args
[argDict setObject:nil forKey:key]; [argDict setObject:@"" forKey:key]; // arg is empty.
done = YES; done = YES;
continue; continue;
} }
else if ([val hasPrefix:@"-"]) else if ([val hasPrefix:@"-"])
{ // Yet another argument { // Yet another argument
[argDict setObject:nil forKey:key]; [argDict setObject:@"" forKey:key]; // arg is empty.
key = val; key = val;
continue; continue;
} }