aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-29 19:11:47 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-29 19:11:51 +0100
commite7bcf3d8a0c83cc7bc3970087beab47a7c7a14bd (patch)
tree87d0e7d4a142224717fe528bd6ce6f76205a95f6 /src/mds-kbdc
parentsome test files (diff)
downloadmds-e7bcf3d8a0c83cc7bc3970087beab47a7c7a14bd.tar.gz
mds-e7bcf3d8a0c83cc7bc3970087beab47a7c7a14bd.tar.bz2
mds-e7bcf3d8a0c83cc7bc3970087beab47a7c7a14bd.tar.xz
mds-kbdc: check that there is something after the :
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/make-tree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c
index 26ee0a7..cdfae40 100644
--- a/src/mds-kbdc/make-tree.c
+++ b/src/mds-kbdc/make-tree.c
@@ -901,6 +901,7 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_parsed_t* restrict res
else if (strchr("\\\"<([0123456789", *line))
{
size_t stack_orig = stack_ptr + 1;
+ char* colon;
#define node supernode
#define inner sequence
NEW_NODE(map, MAP);
@@ -915,10 +916,10 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_parsed_t* restrict res
stack_ptr--;
*end = prev_end_char;
SKIP_SPACES(line);
- if (*line++ != ':')
+ if (colon = line, *line++ != ':')
{
LEAF;
- continue; /* Not an error in macros. */
+ continue; /* Not an error in functions. */
}
BRANCH(":");
#undef inner
@@ -931,6 +932,12 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_parsed_t* restrict res
#define node supernode
LEAF;
#undef node
+ if (supernode->result == NULL)
+ {
+ NEW_ERROR(1, ERROR, "output missing");
+ error->start = (size_t)(colon - LINE);
+ error->end = error->start + 1;
+ }
if (*line == '\0')
continue;
end = line + strlen(line), prev_end_char = *end;