]> git.eshelyaron.com Git - emacs.git/commitdiff
(Freplace_match): Set OPOINT clearly for the case
authorRichard M. Stallman <rms@gnu.org>
Tue, 1 Dec 1998 05:17:11 +0000 (05:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 1 Dec 1998 05:17:11 +0000 (05:17 +0000)
where point is in the middle of the text to be replaced.

src/search.c

index 29a6fe4ff4fb99cb3791a27ea2dca78ecaca3596..e4877b5f498c8af1ba6a12d78aff5e64b1be8b59 100644 (file)
@@ -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;