From f783b1230038603d8798011b75f8b24ed6871338 Mon Sep 17 00:00:00 2001 From: Kyryl Melekhin Date: Fri, 26 Nov 2021 01:20:57 +0000 Subject: [PATCH] fix short circuit match --- pike.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pike.c b/pike.c index 50a0ad4..6bf583c 100644 --- a/pike.c +++ b/pike.c @@ -609,7 +609,7 @@ int re_pikevm(rcode *prog, const char *s, const char **subp, int nsubp) } matched = nsub; } - if (sp == _sp || !nlistidx) { + if (sp == _sp || nlistidx == 1) { for (i = 0, j = i; i < nsubp; i+=2, j++) { subp[i] = matched->sub[j]; subp[i+1] = matched->sub[nsubp / 2 + j];