From 1ecd13fe98e797fef924f3bd1e14ad5d3299c6df Mon Sep 17 00:00:00 2001 From: Petr Tesarik Date: Thu, 11 Oct 2012 17:09:18 +0200 Subject: [PATCH] Make hed_expr_compile more strict and allow empty expressions Why should an invalid atom be ignored? And why should an empty expression be invalid? Now, really? --- libhed/expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libhed/expr.c b/libhed/expr.c index 0ea0e9a..027c176 100644 --- a/libhed/expr.c +++ b/libhed/expr.c @@ -881,7 +881,7 @@ expr_compile_till(char **sexpr, char till) while (**sexpr != till) { struct atom *a = atom_parse(sexpr); if (!a) - continue; + goto err_free; list_add_tail(&a->list, &expr->atoms); if (a->len == SIZE_AUTO) @@ -890,8 +890,6 @@ expr_compile_till(char **sexpr, char till) tmplen = a->len; expr->len += a->len; } - if (list_empty(&expr->atoms)) - goto err_free; if (expr->len) { expr->buf = malloc(expr->len + tmplen); -- 2.11.4.GIT