From ae19d4d1d14efee57afe85ba90048e81120ec68a Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Mon, 18 May 2015 02:19:03 -0300 Subject: source-parser: fixed reserved variables --- src/source-parser.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/source-parser.c b/src/source-parser.c index 13741bd..b556a3c 100644 --- a/src/source-parser.c +++ b/src/source-parser.c @@ -72,8 +72,16 @@ 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))) + if (((current - start == 8) && + (0 == strncmp("FILENAME", src + start, 8))) || + ((current - start == 7) && + (0 == strncmp("CONTENT", src + start, 7))) || + ((current - start == 14) && + (0 == strncmp("DATE_FORMATTED", src + start, 14))) || + ((current - start == 20) && + (0 == strncmp("DATE_FIRST_FORMATTED", src + start, 20))) || + ((current - start == 19) && + (0 == strncmp("DATE_LAST_FORMATTED", src + start, 19)))) { *err = blogc_error_new_printf(BLOGC_ERROR_SOURCE_PARSER, "'%s' variable is forbidden in source files. It will " -- cgit v1.2.3-18-g5258