aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-10 04:41:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-10 04:41:25 +0000
commitfbc87aa03d8f797ab884fc9f06443bd748a82ca1 (patch)
treea7907c49ead2603c71b7e21f62f1c7f8028f7499 /roff.c
parent7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c (diff)
downloadmandoc-fbc87aa03d8f797ab884fc9f06443bd748a82ca1.tar.gz
mandoc-fbc87aa03d8f797ab884fc9f06443bd748a82ca1.tar.zst
mandoc-fbc87aa03d8f797ab884fc9f06443bd748a82ca1.zip
Implement the roff(7) .nop (no operation) request.
Examples of manual pages (ab)using it include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index 86e145e3..fe703f5a 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.329 2018/08/01 15:40:17 schwarze Exp $ */
+/* $Id: roff.c,v 1.330 2018/08/10 04:41:25 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -197,6 +197,7 @@ static enum rofferr roff_line_ignore(ROFF_ARGS);
static void roff_man_alloc1(struct roff_man *);
static void roff_man_free1(struct roff_man *);
static enum rofferr roff_manyarg(ROFF_ARGS);
+static enum rofferr roff_nop(ROFF_ARGS);
static enum rofferr roff_nr(ROFF_ARGS);
static enum rofferr roff_onearg(ROFF_ARGS);
static enum roff_tok roff_parse(struct roff *, char *, int *,
@@ -490,7 +491,7 @@ static struct roffmac roffs[TOKEN_NONE] = {
{ roff_line_ignore, NULL, NULL, 0 }, /* nhychar */
{ roff_unsupp, NULL, NULL, 0 }, /* nm */
{ roff_unsupp, NULL, NULL, 0 }, /* nn */
- { roff_unsupp, NULL, NULL, 0 }, /* nop */
+ { roff_nop, NULL, NULL, 0 }, /* nop */
{ roff_nr, NULL, NULL, 0 }, /* nr */
{ roff_unsupp, NULL, NULL, 0 }, /* nrf */
{ roff_line_ignore, NULL, NULL, 0 }, /* nroff */
@@ -3161,6 +3162,15 @@ roff_eo(ROFF_ARGS)
}
static enum rofferr
+roff_nop(ROFF_ARGS)
+{
+ while (buf->buf[pos] == ' ')
+ pos++;
+ *offs = pos;
+ return ROFF_RERUN;
+}
+
+static enum rofferr
roff_tr(ROFF_ARGS)
{
const char *p, *first, *second;