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
master
Damien Tardy-Panis 5 years ago committed by Drew DeVault
parent 9793e00eef
commit 656484e0ab
  1. 2
      src/main.c
  2. 6
      test/preamble

@ -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);

@ -13,6 +13,12 @@ test
EOF
end 1
begin "Expects a section within the parentheses"
scdoc <<EOF >/dev/null
test()
EOF
end 1
begin "Expects name to alphanumeric"
scdoc <<EOF >/dev/null
!!!!(8)

Loading…
Cancel
Save