aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtins/text.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtins/text.c b/builtins/text.c
index b1e4ce14..f322deb3 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -1752,9 +1752,8 @@ public bool Text$has(Text_t text, Pattern_t pattern)
public bool Text$matches(Text_t text, Pattern_t pattern)
{
- int64_t len = 0;
- int64_t found = _find(text, pattern, 0, 0, &len);
- return (found >= 0) && len == text.length;
+ int64_t m = match(text, 0, pattern, 0, NULL, 0);
+ return m == text.length;
}
public int printf_text_size(const struct printf_info *info, size_t n, int argtypes[n], int sizes[n])