summaryrefslogtreecommitdiff
path: root/lisp/re/re.c
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/re/re.c')
-rw-r--r--lisp/re/re.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/re/re.c b/lisp/re/re.c
index abf5cc4..fca7e28 100644
--- a/lisp/re/re.c
+++ b/lisp/re/re.c
@@ -782,7 +782,8 @@ next_lcstl:;
case Re_AltNext:
bas = eng.off - 1;
/* Check if matched and if it is a better match */
- if (eng.sv[eng.off] - eng.so[eng.off] <
+ if (eng.eo[eng.off] >= eng.so[eng.off] &&
+ eng.sv[eng.off] - eng.so[eng.off] <
eng.eo[eng.off] - eng.so[eng.off])
eng.sv[eng.off] = eng.eo[eng.off];