From 656484e0ab06f86e2f4a35cd6abf6614017bccf8 Mon Sep 17 00:00:00 2001 From: Damien Tardy-Panis Date: Mar 13 2020 12:56:25 +0000 Subject: Section needs to be explicitly defined The absence of value between the section parentheses resulted in the section being 0 (header files), which is unlikely to be the one wanted --- diff --git a/src/main.c b/src/main.c index 1e95838..c55cfa3 100644 --- a/src/main.c +++ b/src/main.c @@ -24,7 +24,7 @@ static int parse_section(struct parser *p) { int ret = str_append_ch(section, ch); assert(ret != -1); } else if (ch == ')') { - if (!section->str) { + if (section->len == 0) { break; } int sec = strtol(section->str, NULL, 10); diff --git a/test/preamble b/test/preamble index 1634877..05c8e2d 100755 --- a/test/preamble +++ b/test/preamble @@ -13,6 +13,12 @@ test EOF end 1 +begin "Expects a section within the parentheses" +scdoc </dev/null +test() +EOF +end 1 + begin "Expects name to alphanumeric" scdoc </dev/null !!!!(8)