From b8e542b46350cc1e7975bb711082e4cc6fcb7c82 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 9 Dec 2022 14:17:35 +0900 Subject: Make absent operator work at the end of the input string https://bugs.ruby-lang.org/issues/19104#change-100542 --- regexec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index f7c5d12133..a9822ee064 100644 --- a/regexec.c +++ b/regexec.c @@ -3774,6 +3774,11 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, DATA_ENSURE(0); p += addr; } + else if (s == end) { + /* At the end of the string, just match with it */ + DATA_ENSURE(0); + p += addr; + } else { STACK_PUSH_ALT(p + addr, s, sprev, pkeep); /* Push possible point. */ n = enclen(encode, s, end); -- cgit v1.2.1