Archived
1
0
Fork 0

compile.c: check filter syntax

This commit is contained in:
Henrik Hautakoski 2011-06-08 18:56:23 +02:00
parent b2df740514
commit 00e149c04c
2 changed files with 3 additions and 2 deletions

View file

@ -11,7 +11,7 @@ install : $(PROGRAMS)
cp $^ $(HOME)/bin/ cp $^ $(HOME)/bin/
dlight : dlight.o env.o http.o rss.o filter.o cconf.o dlhist.o 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-read-config : read-config.o env.o cconf.o
dlight-% : %.o dlight-% : %.o

View file

@ -10,6 +10,7 @@
#include <ctype.h> #include <ctype.h>
#include "env.h" #include "env.h"
#include "cconf.h" #include "cconf.h"
#include "filter.h"
#define error(...) fprintf(stderr, "error: " __VA_ARGS__) #define error(...) fprintf(stderr, "error: " __VA_ARGS__)
@ -141,7 +142,7 @@ static int parse_alias() {
static int parse_filter(struct target *target) { static int parse_filter(struct target *target) {
char *value = parse_value(); char *value = parse_value();
if (!value) if (!value || !filter_check_syntax(value))
return -1; return -1;
cconf_add_filter(target, strdup(value)); cconf_add_filter(target, strdup(value));
return 0; return 0;