From 30391672adadf6613a35903ed2cc1f2edf70948a Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Thu, 30 Apr 2020 14:25:18 +0200 Subject: [PATCH] Exception instead of warning --- src/script/functions/regex.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/script/functions/regex.cpp b/src/script/functions/regex.cpp index d4a04350..457a9084 100644 --- a/src/script/functions/regex.cpp +++ b/src/script/functions/regex.cpp @@ -165,9 +165,7 @@ SCRIPT_FUNCTION_WITH_SIMPLIFY(filter_text) { ret.append(pos.first, pos.second); // the match if (pos.second == start) { // regex matched the empty string, would cause an infinite loop - queue_message(MESSAGE_WARNING, "Regular expression matches empty string in filter_text"); - if (start == input.end()) break; - ++start; + throw ScriptError("Regular expression matches empty string"); } else { start = pos.second; }