aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkatherine <shmibs@airen-no-jikken.icu>2019-05-12 17:04:41 -0700
committerkatherine <shmibs@airen-no-jikken.icu>2019-05-12 17:04:41 -0700
commit4813ad123086b916fca01e2911e70db2b8074c1d (patch)
treee2cc18ed7335cffcd16257fd21ad8518d8a51aa1 /src
parent682972020b2828867b4cffc80eb2dbe0e06ce93b (diff)
downloadconfconf-4813ad123086b916fca01e2911e70db2b8074c1d.tar.gz
check for at fewest one variable rule
Diffstat (limited to 'src')
-rw-r--r--src/parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index 4a6aff8..ce255bb 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -367,6 +367,11 @@ struct parse_result_s parse(FILE *f, const char *fname)
ERR_AT(t.line, t.col, "unexpected token `%s`", t.val);
}
+ if (r.vars == NULL) {
+ fprintf(stderr, "\e[1m%s:\e[0m ", fname);
+ ERR("config must specify at fewest one variable rule");
+ }
+
HASH_ITER(hh, r.vars, vcur, vtmp) {
switch (vcur->type) {
case PARSE_TYPE_DEFTYPE: