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)