1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

buf: Deprecate static/immutable buffers

This commit is contained in:
Nick Wellnhofer
2022-11-14 22:27:58 +01:00
parent 1ca0dfec35
commit 2059df5358
12 changed files with 35 additions and 157 deletions

View File

@@ -773,7 +773,6 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
xmlBufPtr inbuf;
int val, s;
xmlTextReaderState oldstate;
int alloc;
if ((reader->input == NULL) || (reader->input->buffer == NULL))
return(-1);
@@ -781,7 +780,6 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
oldstate = reader->state;
reader->state = XML_TEXTREADER_NONE;
inbuf = reader->input->buffer;
alloc = xmlBufGetAllocationScheme(inbuf);
while (reader->state == XML_TEXTREADER_NONE) {
if (xmlBufUse(inbuf) < reader->cur + CHUNK_SIZE) {
@@ -790,13 +788,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
*/
if (reader->mode != XML_TEXTREADER_MODE_EOF) {
val = xmlParserInputBufferRead(reader->input, 4096);
if ((val == 0) &&
(alloc == XML_BUFFER_ALLOC_IMMUTABLE)) {
if (xmlBufUse(inbuf) == reader->cur) {
reader->mode = XML_TEXTREADER_MODE_EOF;
reader->state = oldstate;
}
} else if (val < 0) {
if (val < 0) {
reader->mode = XML_TEXTREADER_MODE_EOF;
reader->state = oldstate;
if ((oldstate != XML_TEXTREADER_START) ||