mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
- DOCBparser.c: patche from Lszl Kovcs, fixed entities refs
in attributes handling Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Wed May 2 14:39:57 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* DOCBparser.c: patche from L<>szl<7A> Kov<6F>cs, fixed entities refs
|
||||||
|
in attributes handling
|
||||||
|
|
||||||
Wed May 2 12:56:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
Wed May 2 12:56:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
* xmlIO.c: Bjorn Reese provided a fix for a problem on buffer
|
* xmlIO.c: Bjorn Reese provided a fix for a problem on buffer
|
||||||
|
81
DOCBparser.c
81
DOCBparser.c
@ -503,6 +503,7 @@ docbookElementTable[] = {
|
|||||||
{ "date", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
{ "date", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
||||||
{ "dedication", 0, 0, 0, 9, 0, "" }, /* sect.title.content */
|
{ "dedication", 0, 0, 0, 9, 0, "" }, /* sect.title.content */
|
||||||
{ "destructorsynopsis",0,0, 0, 9, 0, "" }, /* modifier */
|
{ "destructorsynopsis",0,0, 0, 9, 0, "" }, /* modifier */
|
||||||
|
{ "docinfo", 0, 0, 0, 9, 0, "" },
|
||||||
{ "edition", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
{ "edition", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
||||||
{ "editor", 0, 0, 0, 9, 0, "" }, /* person.ident.mix */
|
{ "editor", 0, 0, 0, 9, 0, "" }, /* person.ident.mix */
|
||||||
{ "email", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
{ "email", 0, 0, 0, 4, 0, "" }, /* docinfo */
|
||||||
@ -539,8 +540,8 @@ docbookElementTable[] = {
|
|||||||
{ "glossdiv", 0, 0, 0, 9, 0, "" }, /* sect.title.content */
|
{ "glossdiv", 0, 0, 0, 9, 0, "" }, /* sect.title.content */
|
||||||
{ "glossentry", 0, 0, 0, 9, 0, "" }, /* glossterm */
|
{ "glossentry", 0, 0, 0, 9, 0, "" }, /* glossterm */
|
||||||
{ "glosslist", 0, 0, 0, 9, 0, "" }, /* glossentry */
|
{ "glosslist", 0, 0, 0, 9, 0, "" }, /* glossentry */
|
||||||
{ "glossseealso",0, 0, 0, 2, 0, "" }, /* para */
|
{ "glossseealso",0, 0, 1, 2, 0, "" }, /* para */
|
||||||
{ "glosssee", 0, 0, 0, 2, 0, "" }, /* para */
|
{ "glosssee", 0, 0, 1, 2, 0, "" }, /* para */
|
||||||
{ "glossterm", 0, 0, 0, 2, 0, "" }, /* para */
|
{ "glossterm", 0, 0, 0, 2, 0, "" }, /* para */
|
||||||
{ "graphic", 0, 0, 0, 9, 0, "" },
|
{ "graphic", 0, 0, 0, 9, 0, "" },
|
||||||
{ "graphicco", 0, 0, 0, 9, 0, "" }, /* areaspec */
|
{ "graphicco", 0, 0, 0, 9, 0, "" }, /* areaspec */
|
||||||
@ -650,7 +651,7 @@ docbookElementTable[] = {
|
|||||||
{ "prefaceinfo",0, 0, 0, 9, 0, "" }, /* graphic */
|
{ "prefaceinfo",0, 0, 0, 9, 0, "" }, /* graphic */
|
||||||
{ "preface", 0, 0, 0, 9, 0, "" }, /* prefaceinfo */
|
{ "preface", 0, 0, 0, 9, 0, "" }, /* prefaceinfo */
|
||||||
{ "primaryie", 0, 0, 0, 4, 0, "" }, /* ndxterm */
|
{ "primaryie", 0, 0, 0, 4, 0, "" }, /* ndxterm */
|
||||||
{ "primary ", 0, 0, 0, 4, 0, "" }, /* ndxterm */
|
{ "primary", 0, 0, 0, 9, 0, "" }, /* ndxterm */
|
||||||
{ "printhistory",0, 0, 0, 9, 0, "" }, /* para.class */
|
{ "printhistory",0, 0, 0, 9, 0, "" }, /* para.class */
|
||||||
{ "procedure", 0, 0, 0, 9, 0, "" }, /* formalobject.title.content */
|
{ "procedure", 0, 0, 0, 9, 0, "" }, /* formalobject.title.content */
|
||||||
{ "productname",0, 0, 0, 2, 0, "" }, /* para */
|
{ "productname",0, 0, 0, 2, 0, "" }, /* para */
|
||||||
@ -2767,7 +2768,7 @@ docbParseSGMLAttribute(docbParserCtxtPtr ctxt, const xmlChar stop) {
|
|||||||
*out++ = ((c >> bits) & 0x3F) | 0x80;
|
*out++ = ((c >> bits) & 0x3F) | 0x80;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ent = docbParseEntityRef(ctxt, &name);
|
xent = docbParseEntityRef(ctxt, &name);
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
*out++ = '&';
|
*out++ = '&';
|
||||||
if (out - buffer > buffer_size - 100) {
|
if (out - buffer > buffer_size - 100) {
|
||||||
@ -2776,44 +2777,48 @@ docbParseSGMLAttribute(docbParserCtxtPtr ctxt, const xmlChar stop) {
|
|||||||
growBuffer(buffer);
|
growBuffer(buffer);
|
||||||
out = &buffer[indx];
|
out = &buffer[indx];
|
||||||
}
|
}
|
||||||
} else if (ent == NULL) {
|
|
||||||
*out++ = '&';
|
*out++ = '&';
|
||||||
cur = name;
|
|
||||||
while (*cur != 0) {
|
|
||||||
if (out - buffer > buffer_size - 100) {
|
|
||||||
int indx = out - buffer;
|
|
||||||
|
|
||||||
growBuffer(buffer);
|
|
||||||
out = &buffer[indx];
|
|
||||||
}
|
|
||||||
*out++ = *cur++;
|
|
||||||
}
|
|
||||||
xmlFree(name);
|
|
||||||
} else {
|
} else {
|
||||||
unsigned int c;
|
ent = docbEntityLookup(name);
|
||||||
int bits;
|
if (ent == NULL) {
|
||||||
|
*out++ = '&';
|
||||||
|
cur = name;
|
||||||
|
while (*cur != 0) {
|
||||||
|
if (out - buffer > buffer_size - 100) {
|
||||||
|
int indx = out - buffer;
|
||||||
|
|
||||||
if (out - buffer > buffer_size - 100) {
|
growBuffer(buffer);
|
||||||
int indx = out - buffer;
|
out = &buffer[indx];
|
||||||
|
}
|
||||||
|
*out++ = *cur++;
|
||||||
|
}
|
||||||
|
xmlFree(name);
|
||||||
|
} else {
|
||||||
|
unsigned int c;
|
||||||
|
int bits;
|
||||||
|
|
||||||
growBuffer(buffer);
|
if (out - buffer > buffer_size - 100) {
|
||||||
out = &buffer[indx];
|
int indx = out - buffer;
|
||||||
}
|
|
||||||
c = (xmlChar)ent->value;
|
growBuffer(buffer);
|
||||||
if (c < 0x80)
|
out = &buffer[indx];
|
||||||
{ *out++ = c; bits= -6; }
|
}
|
||||||
else if (c < 0x800)
|
c = (xmlChar)ent->value;
|
||||||
{ *out++ =((c >> 6) & 0x1F) | 0xC0; bits= 0; }
|
if (c < 0x80)
|
||||||
else if (c < 0x10000)
|
{ *out++ = c; bits= -6; }
|
||||||
{ *out++ =((c >> 12) & 0x0F) | 0xE0; bits= 6; }
|
else if (c < 0x800)
|
||||||
else
|
{ *out++ =((c >> 6) & 0x1F) | 0xC0; bits= 0; }
|
||||||
{ *out++ =((c >> 18) & 0x07) | 0xF0; bits= 12; }
|
else if (c < 0x10000)
|
||||||
|
{ *out++ =((c >> 12) & 0x0F) | 0xE0; bits= 6; }
|
||||||
for ( ; bits >= 0; bits-= 6) {
|
else
|
||||||
*out++ = ((c >> bits) & 0x3F) | 0x80;
|
{ *out++ =((c >> 18) & 0x07) | 0xF0; bits= 12; }
|
||||||
}
|
|
||||||
xmlFree(name);
|
for ( ; bits >= 0; bits-= 6) {
|
||||||
}
|
*out++ = ((c >> bits) & 0x3F) | 0x80;
|
||||||
|
}
|
||||||
|
xmlFree(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
|
Reference in New Issue
Block a user