From 492b91e4e47c43d15bb828ecbe1e4195c47c31f8 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 28 Jan 2025 07:42:08 +0100 Subject: Backport from xs. --- xs_match.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xs_match.h') diff --git a/xs_match.h b/xs_match.h index 0b89ac8..76c1bf3 100644 --- a/xs_match.h +++ b/xs_match.h @@ -24,6 +24,7 @@ int xs_match(const char *str, const char *spec) retry: for (;;) { + const char *q = spec; char c = *str++; char p = *spec++; @@ -63,8 +64,12 @@ retry: spec = b_spec; str = ++b_str; } - else + else { + if (*q == '|') + spec = q; + break; + } } } } -- cgit v1.2.3