diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index 918fe31..5bcfa22 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -978,6 +978,14 @@ include_statement: switch (tok = gettok(m, s)) { case TOK_IDENTIFIER: matcher_include(m, s, include_depth, m->val.string); + goto include_statement_end; + default: + goto unexpected; + } + +include_statement_end: + switch (tok = gettok(m, s)) { + case TOK_END_OF_LINE: goto initial; default: goto unexpected; diff --git a/test/data/rules/inc-no-newline b/test/data/rules/inc-no-newline new file mode 100644 index 0000000..895c314 --- /dev/null +++ b/test/data/rules/inc-no-newline @@ -0,0 +1 @@ +! include %S/inc-dst-simple !include %S/inc-dst-simple ! layout = symbols diff --git a/test/rules-file-includes.c b/test/rules-file-includes.c index 006449c..17438fd 100644 --- a/test/rules-file-includes.c +++ b/test/rules-file-includes.c @@ -159,6 +159,12 @@ main(int argc, char *argv[]) }; assert(test_rules(ctx, &test6)); + struct test_data test7 = { + .rules = "inc-no-newline", + .should_fail = true, + }; + assert(test_rules(ctx, &test7)); + xkb_context_unref(ctx); return 0; }