diff options
-rw-r--r-- | src/mds-kbdc/make-tree.c | 3 | ||||
-rw-r--r-- | test-files/mds-kbdc/make-tree/invalid/tab-error | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c index 14db125..a8f20ee 100644 --- a/src/mds-kbdc/make-tree.c +++ b/src/mds-kbdc/make-tree.c @@ -864,7 +864,8 @@ static int check_whether_file_is_empty(state_t* restrict state) /* Warn about empty files. */ if (parsing_result->tree == NULL) - NEW_ERROR(0, WARNING, "file is empty"); + if (parsing_result->errors_ptr == 0) + NEW_ERROR(0, WARNING, "file is empty"); return 0; pfail: diff --git a/test-files/mds-kbdc/make-tree/invalid/tab-error b/test-files/mds-kbdc/make-tree/invalid/tab-error new file mode 100644 index 0000000..0a67263 --- /dev/null +++ b/test-files/mds-kbdc/make-tree/invalid/tab-error @@ -0,0 +1,6 @@ + : + +# :1:8–9: error: invalid syntax ‘:’ +# : +# ^ + |