From 9160906f27f60f33916004ea241d84cd3fb178d0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 1 Dec 1998 05:17:11 +0000 Subject: [PATCH] (Freplace_match): Set OPOINT clearly for the case where point is in the middle of the text to be replaced. --- src/search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/search.c b/src/search.c index 29a6fe4ff4f..e4877b5f498 100644 --- a/src/search.c +++ b/src/search.c @@ -2417,8 +2417,10 @@ since only regular expressions have distinguished subexpressions.") } /* Record point, the move (quietly) to the start of the match. */ - if (PT > search_regs.start[sub]) + if (PT >= search_regs.end[sub]) opoint = PT - ZV; + else if (PT > search_regs.start[sub]) + opoint = search_regs.end[sub] - ZV; else opoint = PT; -- 2.39.5