mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
encoding fixup for xml with bad dictionary key
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29070 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b92879f11d
commit
449c94d4f6
1 changed files with 18 additions and 16 deletions
|
@ -2062,11 +2062,16 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
for (i = 0; i < numKeys; i++)
|
||||
{
|
||||
keys[i] = [keyArray objectAtIndex: i];
|
||||
plists[i] = [(NSDictionary*)obj objectForKey: keys[i]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[keyArray getObjects: keys];
|
||||
for (i = 0; i < numKeys; i++)
|
||||
{
|
||||
plists[i] = (*myObj)(obj, objSel, keys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (x == NSPropertyListXMLFormat_v1_0)
|
||||
|
@ -2089,6 +2094,10 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (numKeys == 0)
|
||||
{
|
||||
canCompare = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All keys must respond to -compare: for sorting.
|
||||
|
@ -2159,8 +2168,16 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
badComparison = YES;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Swap keys and values.
|
||||
*/
|
||||
keys[d + stride] = b;
|
||||
keys[d] = a;
|
||||
a = plists[d + stride];
|
||||
b = plists[d];
|
||||
plists[d + stride] = b;
|
||||
plists[d] = a;
|
||||
|
||||
if (stride > d)
|
||||
{
|
||||
break;
|
||||
|
@ -2189,21 +2206,6 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
#endif
|
||||
}
|
||||
|
||||
if (isProxy == YES)
|
||||
{
|
||||
for (i = 0; i < numKeys; i++)
|
||||
{
|
||||
plists[i] = [(NSDictionary*)obj objectForKey: keys[i]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < numKeys; i++)
|
||||
{
|
||||
plists[i] = (*myObj)(obj, objSel, keys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (x == NSPropertyListXMLFormat_v1_0)
|
||||
{
|
||||
[dest appendBytes: "<dict>\n" length: 7];
|
||||
|
@ -2211,7 +2213,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
{
|
||||
[dest appendBytes: iSizeString length: strlen(iSizeString)];
|
||||
[dest appendBytes: "<key>" length: 5];
|
||||
XString([keys[i] description], dest);
|
||||
XString(keys[i], dest);
|
||||
[dest appendBytes: "</key>\n" length: 7];
|
||||
[dest appendBytes: iSizeString length: strlen(iSizeString)];
|
||||
OAppend(plists[i], loc, level, step, x, dest);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue