~sircmpwn/scdoc

656484e0ab06f86e2f4a35cd6abf6614017bccf8 — Damien Tardy-Panis 2 months ago 9793e00
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
2 files changed, 7 insertions(+), 1 deletions(-)

M src/main.c
M test/preamble
M src/main.c => src/main.c +1 -1
@@ 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);

M test/preamble => test/preamble +6 -0
@@ 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)