Fix parsing of line breaks without newline

master
Damien Tardy-Panis 5 years ago committed by Drew DeVault
parent 059002cd2c
commit da7d5e6c19
  1. 2
      src/main.c
  2. 8
      test/line-breaks

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

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

Loading…
Cancel
Save