From c81b46f68faf94738e7c96bece4a2627451aceb4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 23 Jun 2012 14:07:01 +0300 Subject: [PATCH] Backport: 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 2173778c29c..68bb4a030fb 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-21 Glenn Morris * 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++; } -- 2.39.5