From da7d5e6c19b3eff93483746e3e111d2ddf7343f8 Mon Sep 17 00:00:00 2001 From: Damien Tardy-Panis Date: Tue, 19 May 2020 18:19:49 +0200 Subject: [PATCH] Fix parsing of line breaks without newline --- src/main.c | 2 +- test/line-breaks | 8 ++++++++ diff --git a/src/main.c b/src/main.c index 603c91eac6c6be3cb8472c9faf6705c88c9d2179..08bf384e0c4ba19450c78c0bb45b4240229281a4 100644 --- a/src/main.c +++ b/src/main.c @@ -186,8 +186,8 @@ } 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); diff --git a/test/line-breaks b/test/line-breaks index c6c2fc43940b6aef250ef378f742f74cf96cd971..e97332fe11d0e24052a4eb297e9b6a0fdc7aca33 100755 --- a/test/line-breaks +++ b/test/line-breaks @@ -27,3 +27,11 @@ hello+world EOF end 0 + +begin "Leave double + without newline" +scdoc </dev/null +test(8) + +hello++world +EOF +end 0 -- 2.48.1