From 23ed40d55f3ff2b30f3b3fe01edfb51e418292b4 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 1 Aug 2022 16:59:19 +0200 Subject: fixed up last commit --- include/stc/cregex.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/stc/cregex.h') diff --git a/include/stc/cregex.h b/include/stc/cregex.h index 3747eaf7..e828e944 100644 --- a/include/stc/cregex.h +++ b/include/stc/cregex.h @@ -71,7 +71,8 @@ typedef struct { } cregex; #define c_foreach_match(m, re, input) \ - for (csview m[cre_MAXCAPTURES] = {{0}}; cregex_find(input, &(re), m, cre_m_next) == cre_success;) + for (csview m[cre_MAXCAPTURES] = {{0}}, _c_in = csview_from(input); \ + cregex_find(_c_in.str, &(re), m, cre_m_next) == cre_success; ) //typedef csview cregmatch; -- cgit v1.2.3