aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit706d9945acc722dd472698b7a9a81d213d8d9e0f (patch)
tree38a7ede6a11442f497a76006cb1f6834974ea3cd /roff.c
parent259fee714b55e40e21cea678c54f18c63f478063 (diff)
downloadmandoc-706d9945acc722dd472698b7a9a81d213d8d9e0f.tar.gz
mandoc-706d9945acc722dd472698b7a9a81d213d8d9e0f.tar.zst
mandoc-706d9945acc722dd472698b7a9a81d213d8d9e0f.zip
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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index f5de0f32..bd8c8250 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.333 2018/08/18 02:08:27 schwarze Exp $ */
+/* $Id: roff.c,v 1.334 2018/08/18 21:37:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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--;