summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-09-24 23:23:02 +0900
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:14 +0800
commit75608ea223ec952d0927a7773c6cfbfe87fc73a3 (patch)
tree0a5d863715b97cc847d1c45b5b00a0fe270223c2 /src
parent490c130e412583e21de15450bf746253369c235e (diff)
Regex: when in full match mode, do not accept trailing data
Diffstat (limited to 'src')
-rw-r--r--src/regex_impl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc
index 225b83cf..3ad30988 100644
--- a/src/regex_impl.cc
+++ b/src/regex_impl.cc
@@ -695,6 +695,9 @@ struct ThreadedRegexVM
const auto res = step(i);
if (res == StepResult::Matched)
{
+ if (match)
+ continue; // We are not at end, this is not a full match
+
m_captures = std::move(m_threads[i].saves);
found_match = true;
m_threads.resize(i); // remove this and lower priority threads
@@ -768,6 +771,7 @@ auto test_regex = UnitTest{[]{
kak_assert(vm.exec("ab"));
kak_assert(vm.exec("aaab"));
kak_assert(not vm.exec("acb"));
+ kak_assert(not vm.exec("abc"));
kak_assert(not vm.exec(""));
}