From 52c55cc7d2bec9795533f58e15c61f7a7b51d1b0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 23 May 2012 20:32:28 +0300 Subject: Fix bug #11519 with relocation of buffer text during regex search. src/lisp.h [REL_ALLOC]: Add prototypes for external functions defined on ralloc.c. src/buffer.c [REL_ALLOC]: Remove prototypes of r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free, they are now on lisp.h. src/ralloc.c (r_alloc_inhibit_buffer_relocation): New function. src/search.c (search_buffer): Use it to inhibit relocation of buffer text while re_search_2 is doing its job, because re_search_2 is passed C pointers to buffer text. --- src/ralloc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ralloc.c') diff --git a/src/ralloc.c b/src/ralloc.c index 896ad9f3155..db3638a54e6 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1201,6 +1201,12 @@ r_alloc_reset_variable (POINTER *old, POINTER *new) bloc->variable = new; } +void +r_alloc_inhibit_buffer_relocation (int inhibit) +{ + use_relocatable_buffers = !inhibit; +} + /*********************************************************************** Initialization -- cgit v1.2.3