diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2022-12-09 14:17:35 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2022-12-12 14:26:38 +0900 |
commit | b8e542b46350cc1e7975bb711082e4cc6fcb7c82 (patch) | |
tree | a5a2201d4e88006970eb8eebd56d2e73eea8b17c /regexec.c | |
parent | f093b619a4863be96e6ebfa2fd58c77f4a360eae (diff) | |
download | ruby-b8e542b46350cc1e7975bb711082e4cc6fcb7c82.tar.gz |
Make absent operator work at the end of the input string
https://bugs.ruby-lang.org/issues/19104#change-100542
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |