Support unescaping#x and #X entities

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22623 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-03-08 18:14:42 +00:00
parent 48d81791bc
commit 0060ce88ce
2 changed files with 10 additions and 1 deletions

View file

@ -8,6 +8,7 @@
* Source/NSFileManager.m: don't abort directory copy just because
we can't set attributes of destination directory. Don't try to
copy directories with their old owners.
* Source/Additions/GSXML.m: Support #x and #X unescaping.
* Source/NSSocketPortNameServer.m:
* Source/NSBundle.m:
* Source/NSProcessInfo.m:

View file

@ -4259,7 +4259,15 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
{
unichar u;
if ([s hasPrefix: @"&#0x"] || [s hasPrefix: @"&#0X"])
if ([s hasPrefix: @"&#x"] || [s hasPrefix: @"&#X"])
{
unsigned val = 0;
s = [s substringFromIndex: 3];
sscanf([s UTF8String], "%x", &val);
u = val;
}
else if ([s hasPrefix: @"&#0x"] || [s hasPrefix: @"&#0X"])
{
unsigned val = 0;