~sircmpwn/scdoc

da7d5e6c19b3eff93483746e3e111d2ddf7343f8 — Damien Tardy-Panis 6 days ago 059002c
Fix parsing of line breaks without newline
2 files changed, 9 insertions(+), 1 deletions(-)

M src/main.c
M test/line-breaks
M src/main.c => src/main.c +1 -1
@@ 186,8 186,8 @@ static void parse_linebreak(struct parser *p) {
	uint32_t lf = parser_getch(p);
	if (lf != '\n') {
		fprintf(p->output, "+");
		parser_pushch(p, lf);
		parser_pushch(p, plus);
		parser_pushch(p, '\n');
		return;
	}
	uint32_t ch = parser_getch(p);

M test/line-breaks => test/line-breaks +8 -0
@@ 27,3 27,11 @@ test(8)
hello+world
EOF
end 0

begin "Leave double + without newline"
scdoc <<EOF | grep 'hello++world' >/dev/null
test(8)

hello++world
EOF
end 0