From b81e0c2b1c70badf4131cf8a587a06e1c31df1f5 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 19 Apr 2015 14:36:19 -0300 Subject: loader: added compiler-defined variables --- src/source-parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/source-parser.c') diff --git a/src/source-parser.c b/src/source-parser.c index b6b7fd0..322906f 100644 --- a/src/source-parser.c +++ b/src/source-parser.c @@ -11,6 +11,7 @@ #endif /* HAVE_CONFIG_H */ #include +#include #include "utils/utils.h" #include "source-parser.h" @@ -70,6 +71,14 @@ blogc_source_parse(const char *src, size_t src_len, blogc_error_t **err) break; if (c == ':') { key = b_strndup(src + start, current - start); + if ((0 == strncmp("FILENAME", src + start, current - start)) || + (0 == strncmp("CONTENT", src + start, current - start))) + { + *err = blogc_error_new_printf(BLOGC_ERROR_SOURCE_PARSER, + "'%s' variable is forbidden in source files. It will " + "be set for you by the compiler.", key); + break; + } state = SOURCE_CONFIG_VALUE_START; break; } -- cgit v1.2.3-18-g5258