summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-18 21:37:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-18 21:37:01 +0000
commit1455968b313b58229631f0bab810b23bddda5bec (patch)
treed32bcca0493c4c2f44bed82cc0d55a1acba6682e /roff.c
parent8b1b37e7f46325fa75c9422a04c627989c901577 (diff)
downloadmandoc-1455968b313b58229631f0bab810b23bddda5bec.tar.gz
support the highly surprising escape sequence \# (line continuation
with comment); used for example by gropdf(1)
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c9
1 files changed, 8 insertions, 1 deletions
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--;