mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15820 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
24b7bf3d69
commit
85eeae90e8
2 changed files with 24 additions and 4 deletions
|
@ -1982,6 +1982,25 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
(void*)&newVal) < 0)
|
(void*)&newVal) < 0)
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Unable to set substituteEntities"];
|
format: @"Unable to set substituteEntities"];
|
||||||
|
|
||||||
|
newVal = -1;
|
||||||
|
if (xmlGetFeature((xmlParserCtxtPtr)lib, "substitute entities",
|
||||||
|
(void*)&newVal) < 0)
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"Unable to get substituteEntities"];
|
||||||
|
if (yesno == YES)
|
||||||
|
{
|
||||||
|
if (newVal != 1)
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"Unable to set substituteEntities to 1"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (newVal != 0)
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"Unable to set substituteEntities to 0"];
|
||||||
|
}
|
||||||
|
xmlSubstituteEntitiesDefault(newVal); // Set default too.
|
||||||
return (oldVal == 1) ? YES : NO;
|
return (oldVal == 1) ? YES : NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -539,13 +539,14 @@ UTF8String_c(ivars self)
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (intEnc == NSISOLatin1StringEncoding || intEnc == NSASCIIStringEncoding)
|
if (intEnc == NSASCIIStringEncoding)
|
||||||
{
|
{
|
||||||
r = (unsigned char*)_fastMallocBuffer(self->_count+1);
|
unsigned i = self->_count;
|
||||||
|
|
||||||
if (self->_count > 0)
|
r = (unsigned char*)_fastMallocBuffer(self->_count+1);
|
||||||
|
while (i-- > 0)
|
||||||
{
|
{
|
||||||
memcpy(r, self->_contents.c, self->_count);
|
r[i] = self->_contents.c[i] & 0x7f;
|
||||||
}
|
}
|
||||||
r[self->_count] = '\0';
|
r[self->_count] = '\0';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue