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:
10
xmlreader.c
10
xmlreader.c
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user