bugGNUstep - Bugs: bug #12801, string starting with '{' in a PL...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12801: string starting with '{' in a PL is read as dictionary

Submitted by:  Benhur Stein <benhur>
Submitted on:  Mon 25 Apr 2005 01:23:43 PM UTC  
 
Category: Base/FoundationSeverity: 2 - Minor
Item Group: BugStatus: Works For Me
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 03 Jun 2005 12:45:34 PM UTC, comment #3:

There was a bug in the defaults program which prevented entry of strings containing '{'. This is fixed in CVS.

Richard Frith-Macdonald <CaS>
Project Member
Mon 25 Apr 2005 03:01:32 PM UTC, comment #2:

You are right, I updated base and it works OK.
However, how can I insert a string like this with the "defaults" program?

Thanks,
Benhur

Benhur Stein <benhur>
Mon 25 Apr 2005 02:04:12 PM UTC, comment #1:

I tried your code with the current gnustep (from CVS) and was unable to reproduce the problem ... ie the value decoded from the defaults system as a string.

Can you produce a test program to demonstrate the problem with the current base library?

Richard Frith-Macdonald <CaS>
Project Member
Mon 25 Apr 2005 01:23:43 PM UTC, original submission:

If a string starting with the '{' character is stored in a property list, it is read as a dictionary, not as a string.
The following code does not work, cellSizeString is read as nil:

[[NSUserDefaults standardUserDefaults]
setObject:NSStringFromSize(cellSize)
forKey:@"StatViewerCellSize"];

/* ... */
cellSizeString = [[NSUserDefaults standardUserDefaults]
stringForKey:@"StatViewerCellSize"];
if (cellSizeString != nil) {
cellSize = NSSizeFromString(cellSizeString);
}

When looking at the .GNUstepDefaults file, this string is properly written surrounded by quotes, while dictionaries are written without the quotes.
A similar problem probably exists with arrays and data.
Not sure how to make the distinction when writing a default value using the "defaults" tool, though.

Benhur

Benhur Stein <benhur>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 03 Jun 2005 12:45:34 PM UTCCaSOpen/ClosedOpen=>Closed
Mon 25 Apr 2005 02:04:12 PM UTCCaSStatusNone=>Works For Me

Back to the top


Powered by Savane 3.1-cleanup1