From 00e149c04c237b5429e22adbcadc623bc321ff67 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 8 Jun 2011 18:56:23 +0200 Subject: [PATCH] compile.c: check filter syntax --- Makefile | 2 +- compile.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ea8a713..5a4ae70 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ install : $(PROGRAMS) cp $^ $(HOME)/bin/ dlight : dlight.o env.o http.o rss.o filter.o cconf.o dlhist.o -dlight-compile : compile.o env.o cconf.o +dlight-compile : compile.o env.o filter.o cconf.o dlight-read-config : read-config.o env.o cconf.o dlight-% : %.o diff --git a/compile.c b/compile.c index 83b0f9a..9ea3f2a 100644 --- a/compile.c +++ b/compile.c @@ -10,6 +10,7 @@ #include #include "env.h" #include "cconf.h" +#include "filter.h" #define error(...) fprintf(stderr, "error: " __VA_ARGS__) @@ -141,7 +142,7 @@ static int parse_alias() { static int parse_filter(struct target *target) { char *value = parse_value(); - if (!value) + if (!value || !filter_check_syntax(value)) return -1; cconf_add_filter(target, strdup(value)); return 0;