summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog6
-rw-r--r--src/ralloc.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2173778c29c..68bb4a030fb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-23 Eli Zaretskii <eliz@gnu.org>
+
+ * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
+ in the logic of incrementing and decrementing the value of
+ use_relocatable_buffers.
+
2012-06-21 Glenn Morris <rgm@gnu.org>
* charset.c (init_charset): Make lack of etc/charsets fatal.
diff --git a/src/ralloc.c b/src/ralloc.c
index 2e4823dc6c1..b1a5982574f 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -757,7 +757,7 @@ r_alloc_sbrk (long int size)
if (! r_alloc_initialized)
r_alloc_init ();
- if (! use_relocatable_buffers)
+ if (use_relocatable_buffers <= 0)
return (*real_morecore) (size);
if (size == 0)
@@ -1204,12 +1204,12 @@ r_alloc_reset_variable (POINTER *old, POINTER *new)
void
r_alloc_inhibit_buffer_relocation (int inhibit)
{
- if (use_relocatable_buffers < 0)
- use_relocatable_buffers = 0;
+ if (use_relocatable_buffers > 1)
+ use_relocatable_buffers = 1;
if (inhibit)
- use_relocatable_buffers++;
- else if (use_relocatable_buffers > 0)
use_relocatable_buffers--;
+ else if (use_relocatable_buffers < 1)
+ use_relocatable_buffers++;
}