From ed2af64ee8c1b6f976e3223dc2de325e10f228a0 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 18 Jul 2014 00:27:11 +0000 Subject: [PATCH] f_syntax: set regexec nmatch to 0. this is correct according to POSIX with REG_NOSUB, but it doesn't make much sense to set to > 0 when pmatch is NULL and will crash on musl (reported to the musl project too). --- sandy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandy.c b/sandy.c index 5d049f3..0305d10 100644 --- a/sandy.c +++ b/sandy.c @@ -482,7 +482,7 @@ f_syntax(const Arg *arg) { statusflags|=S_DirtyScr; for(i=0; iv) ? !strcmp(arg->v, syntaxes[i].name) - : !regexec(syntax_file_res[i], filename, 1, NULL, 0)) { + : !regexec(syntax_file_res[i], filename, 0, NULL, 0)) { for(j=0; j= 0) && syntax_res[syntx][j]) regfree(syntax_res[syntx][j]); if(syntaxes[i].re_text[j] && regcomp(syntax_res[i][j], syntaxes[i].re_text[j], REG_EXTENDED|REG_NEWLINE)) i_die("Faulty regex.\n"); -- 2.0.2