From e8a022046f57aa23f605593e0ccd901da1776c5e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 23 Jun 2012 12:46:33 +0300 Subject: [PATCH] Really fix bug #11519, by fixing the last change in ralloc.c. src/ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko in the logic of incrementing and decrementing the value of use_relocatable_buffers. --- src/ChangeLog | 6 ++++++ src/ralloc.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e5d77d66b0c..557a844c8f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-06-23 Eli Zaretskii + + * 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-23 Paul Eggert * sysdep.c [__FreeBSD__]: Fix recently-introduced typos. diff --git a/src/ralloc.c b/src/ralloc.c index 19d15664eec..0d8bcaf4ffb 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -741,7 +741,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) @@ -1142,12 +1142,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++; } -- 2.39.2