aboutsummaryrefslogtreecommitdiffstats
path: root/src/source-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 02:19:03 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 02:19:03 -0300
commitae19d4d1d14efee57afe85ba90048e81120ec68a (patch)
treece83ec740f08058cd1df2d8102626ec7ed95124d /src/source-parser.c
parent26fe49e2f51f653798866614d3f92e4a237e2be5 (diff)
downloadblogc-ae19d4d1d14efee57afe85ba90048e81120ec68a.tar.gz
blogc-ae19d4d1d14efee57afe85ba90048e81120ec68a.tar.bz2
blogc-ae19d4d1d14efee57afe85ba90048e81120ec68a.zip
source-parser: fixed reserved variables
Diffstat (limited to 'src/source-parser.c')
-rw-r--r--src/source-parser.c12
1 files changed, 10 insertions, 2 deletions
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 "