aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/search.c4
1 files changed, 3 insertions, 1 deletions
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.")
2417 } 2417 }
2418 2418
2419 /* Record point, the move (quietly) to the start of the match. */ 2419 /* Record point, the move (quietly) to the start of the match. */
2420 if (PT > search_regs.start[sub]) 2420 if (PT >= search_regs.end[sub])
2421 opoint = PT - ZV; 2421 opoint = PT - ZV;
2422 else if (PT > search_regs.start[sub])
2423 opoint = search_regs.end[sub] - ZV;
2422 else 2424 else
2423 opoint = PT; 2425 opoint = PT;
2424 2426