From a27e08280bc6fa4e58d492b25d4466eccd650b2a Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Mon, 25 Nov 2002 15:53:52 +0000 Subject: [PATCH] Minor arg handling tidyup git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15096 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSUserDefaults.m | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d9642bcb..daffb23b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-25 Richard Frith-Macdonald + + * Source/NSUserDefaults.m: Treat '-' on its own as an argument + rather than the start of a flag name. + 2002-11-20 Richard Frith-Macdonald * Source/libgnustep-base.def: Add garbage collecting classes. diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index 93576a3ae..35f6d876f 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -1696,7 +1696,7 @@ static BOOL isPlistObject(id o) while (!done) { - if ([key hasPrefix: @"-"]) + if ([key hasPrefix: @"-"] == YES && [key isEqual: @"-"] == NO) { NSString *old = nil; @@ -1719,7 +1719,7 @@ static BOOL isPlistObject(id o) done = YES; continue; } - else if ([val hasPrefix: @"-"] == YES) + else if ([val hasPrefix: @"-"] == YES && [val isEqual: @"-"] == NO) { // Yet another argument [argDict setObject: @"" forKey: key]; // arg is empty. if (old != nil)