From 1455968b313b58229631f0bab810b23bddda5bec Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 18 Aug 2018 21:37:01 +0000 Subject: support the highly surprising escape sequence \# (line continuation with comment); used for example by gropdf(1) --- roff.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index 91f4b1fb..705fddeb 100644 --- a/roff.c +++ b/roff.c @@ -1205,7 +1205,14 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) r->man->next = ROFF_NEXT_SIBLING; } - /* Discard comments. */ + /* Line continuation with comment. */ + + if (stesc[1] == '#') { + *stesc = '\0'; + return ROFF_APPEND; + } + + /* Discard normal comments. */ while (stesc > start && stesc[-1] == ' ') stesc--; -- cgit