From a4cf695e60e0d4f79638cb1f37f78b524411efcf Mon Sep 17 00:00:00 2001 From: default Date: Fri, 7 Oct 2022 13:48:53 +0200 Subject: Backport from xs. --- xs_regex.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xs_regex.h') diff --git a/xs_regex.h b/xs_regex.h index 9221233..e0d1b7a 100644 --- a/xs_regex.h +++ b/xs_regex.h @@ -60,9 +60,10 @@ d_char *xs_regex_match_n(const char *str, const char *rx, int count) int n = 0; /* split */ - p = split = xs_regex_split_n(str, rx, count); + split = xs_regex_split_n(str, rx, count); /* now iterate to get only the 'separators' (odd ones) */ + p = split; while (xs_list_iter(&p, &v)) { if (n & 0x1) list = xs_list_append(list, v); -- cgit v1.2.3