summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/regex2.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-26 00:27:45 +0100
committerTyge Løvset <[email protected]>2023-03-26 00:27:45 +0100
commiteb85069b669e754836b9d4587ba03d3af1a5e975 (patch)
tree45c9a0d3fe40c59a8b33ae8ecd2e7aa78bef6240 /misc/examples/regex2.c
parente8be14dfc894eeac859f0287d4d5b4f4745c0585 (diff)
downloadSTC-modified-eb85069b669e754836b9d4587ba03d3af1a5e975.tar.gz
STC-modified-eb85069b669e754836b9d4587ba03d3af1a5e975.zip
development branch for 4.2
Removed uses of c_auto and c_with in documentation examples and code examples. Still using c_defer a few places. Renamed c11/fmt.h to c11/print.h. Some additions in ccommon.h, e.g. c_const_cast(T, x). Improved docs.
Diffstat (limited to 'misc/examples/regex2.c')
-rw-r--r--misc/examples/regex2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c
index 20bd323c..883dd112 100644
--- a/misc/examples/regex2.c
+++ b/misc/examples/regex2.c
@@ -15,7 +15,7 @@ int main()
{"\\p{Han}+", "This is Han: 王明:那是杂志吗?"},
};
- c_auto (cregex, re)
+ cregex re = {0};
c_forrange (i, c_ARRAYLEN(s))
{
int res = cregex_compile(&re, s[i].pattern);
@@ -30,4 +30,5 @@ int main()
printf(" submatch %lld: %.*s\n", k, c_SV(j.match[k]));
}
}
+ cregex_drop(&re);
}