summaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2009-03-01 10:54:34 +0100
committerMike Hommey <glandium@debian.org>2009-03-01 10:54:34 +0100
commit0c1d871e4c5e46a2945cccb2ce765f9be2fe01fb (patch)
tree982382b30eb118c65e1a06b25757dac5c3c69b8d /tree.c
parentd03a853bb0370d89552eceee59df1746da4a37f8 (diff)
downloadlibxml2-upstream/2.7.1.dfsg.tar.gz
Import upstream version 2.7.1upstream/2.7.1.dfsg
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tree.c b/tree.c
index f26748e..76926fd 100644
--- a/tree.c
+++ b/tree.c
@@ -680,7 +680,9 @@ try_complex:
*/
void
xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme) {
- xmlBufferAllocScheme = scheme;
+ if ((scheme == XML_BUFFER_ALLOC_EXACT) ||
+ (scheme == XML_BUFFER_ALLOC_DOUBLEIT))
+ xmlBufferAllocScheme = scheme;
}
/**
@@ -6736,9 +6738,12 @@ xmlBufferSetAllocationScheme(xmlBufferPtr buf,
#endif
return;
}
- if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return;
-
- buf->alloc = scheme;
+ if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) ||
+ (buf->alloc == XML_BUFFER_ALLOC_IO)) return;
+ if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
+ (scheme == XML_BUFFER_ALLOC_EXACT) ||
+ (scheme == XML_BUFFER_ALLOC_IMMUTABLE))
+ buf->alloc = scheme;
}
/**