aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--man_html.c3
-rw-r--r--man_macro.c3
-rw-r--r--man_term.c12
-rw-r--r--man_validate.c1
-rw-r--r--mandocdb.c3
-rw-r--r--mdoc_argv.c3
-rw-r--r--mdoc_html.c3
-rw-r--r--mdoc_macro.c5
-rw-r--r--mdoc_man.c50
-rw-r--r--mdoc_markdown.c8
-rw-r--r--mdoc_state.c3
-rw-r--r--mdoc_term.c25
-rw-r--r--mdoc_validate.c3
-rw-r--r--roff.c9
-rw-r--r--roff.h6
-rw-r--r--roff_term.c11
-rw-r--r--roff_validate.c1
17 files changed, 59 insertions, 90 deletions
diff --git a/man_html.c b/man_html.c
index e895698f..ef0a2cc5 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.139 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: man_html.c,v 1.140 2017/05/05 13:17:54 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -107,7 +107,6 @@ static const struct htmlman __mans[MAN_MAX - MAN_TH] = {
{ NULL, NULL }, /* EE */
{ man_UR_pre, NULL }, /* UR */
{ NULL, NULL }, /* UE */
- { man_ign_pre, NULL }, /* ll */
};
static const struct htmlman *const mans = __mans - MAN_TH;
diff --git a/man_macro.c b/man_macro.c
index a2c3f68d..84e2b9c9 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.118 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: man_macro.c,v 1.119 2017/05/05 13:17:54 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -76,7 +76,6 @@ const struct man_macro __man_macros[MAN_MAX - MAN_TH] = {
{ in_line_eoln, MAN_BSCOPE }, /* EE */
{ blk_exp, MAN_BSCOPE }, /* UR */
{ blk_close, MAN_BSCOPE }, /* UE */
- { in_line_eoln, 0 }, /* ll */
};
const struct man_macro *const man_macros = __man_macros - MAN_TH;
diff --git a/man_term.c b/man_term.c
index ac04dd6f..ba096f0d 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.195 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: man_term.c,v 1.196 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -83,7 +83,6 @@ static int pre_alternate(DECL_ARGS);
static int pre_ign(DECL_ARGS);
static int pre_in(DECL_ARGS);
static int pre_literal(DECL_ARGS);
-static int pre_ll(DECL_ARGS);
static int pre_sp(DECL_ARGS);
static void post_IP(DECL_ARGS);
@@ -130,7 +129,6 @@ static const struct termact __termacts[MAN_MAX - MAN_TH] = {
{ pre_literal, NULL, 0 }, /* EE */
{ pre_UR, post_UR, 0 }, /* UR */
{ NULL, NULL, 0 }, /* UE */
- { pre_ll, NULL, MAN_NOTEXT }, /* ll */
};
static const struct termact *termacts = __termacts - MAN_TH;
@@ -217,14 +215,6 @@ pre_ign(DECL_ARGS)
}
static int
-pre_ll(DECL_ARGS)
-{
-
- term_setwidth(p, n->child != NULL ? n->child->string : NULL);
- return 0;
-}
-
-static int
pre_I(DECL_ARGS)
{
diff --git a/man_validate.c b/man_validate.c
index 812e7743..9b3ae239 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -89,7 +89,6 @@ static const v_check __man_valids[MAN_MAX - MAN_TH] = {
NULL, /* EE */
post_UR, /* UR */
NULL, /* UE */
- NULL, /* ll */
};
static const v_check *man_valids = __man_valids - MAN_TH;
diff --git a/mandocdb.c b/mandocdb.c
index f7dfcab0..dccbc930 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.247 2017/05/04 17:48:28 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.248 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -305,7 +305,6 @@ static const struct mdoc_handler __mdocs[MDOC_MAX - MDOC_Dd] = {
{ NULL, 0, 0 }, /* sp */
{ NULL, 0, 0 }, /* %U */
{ NULL, 0, 0 }, /* Ta */
- { NULL, 0, 0 }, /* ll */
};
static const struct mdoc_handler *const mdocs = __mdocs - MDOC_Dd;
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 7cc2e1ba..0402a01f 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.112 2017/05/04 17:48:29 schwarze Exp $ */
+/* $Id: mdoc_argv.c,v 1.113 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -266,7 +266,6 @@ static const struct mdocarg __mdocargs[MDOC_MAX - MDOC_Dd] = {
{ ARGSFL_NONE, NULL }, /* sp */
{ ARGSFL_NONE, NULL }, /* %U */
{ ARGSFL_NONE, NULL }, /* Ta */
- { ARGSFL_NONE, NULL }, /* ll */
};
static const struct mdocarg *const mdocargs = __mdocargs - MDOC_Dd;
diff --git a/mdoc_html.c b/mdoc_html.c
index 48e3b81c..b492af4a 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.283 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.284 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -240,7 +240,6 @@ static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_Dd] = {
{mdoc_sp_pre, NULL}, /* sp */
{mdoc__x_pre, mdoc__x_post}, /* %U */
{NULL, NULL}, /* Ta */
- {mdoc_skip_pre, NULL}, /* ll */
};
static const struct htmlmdoc *const mdocs = __mdocs - MDOC_Dd;
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 30ef7e4d..2eb257dc 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.221 2017/05/04 17:48:29 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.222 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -200,7 +200,6 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX - MDOC_Dd] = {
{ in_line_eoln, 0 }, /* sp */
{ in_line_eoln, 0 }, /* %U */
{ phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */
- { in_line_eoln, MDOC_PROLOGUE }, /* ll */
};
const struct mdoc_macro *const mdoc_macros = __mdoc_macros - MDOC_Dd;
@@ -250,7 +249,7 @@ lookup(struct roff_man *mdoc, int from, int line, int ppos, const char *p)
if (res != TOKEN_NONE) {
if (mdoc_macros[res].flags & MDOC_CALLABLE)
return res;
- if (res != MDOC_sp && res != MDOC_ll)
+ if (res != MDOC_sp)
mandoc_msg(MANDOCERR_MACRO_CALL,
mdoc->parse, line, ppos, p);
}
diff --git a/mdoc_man.c b/mdoc_man.c
index 20796006..61b4c870 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.111 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.112 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -33,10 +33,13 @@
#define DECL_ARGS const struct roff_meta *meta, struct roff_node *n
+typedef int (*int_fp)(DECL_ARGS);
+typedef void (*void_fp)(DECL_ARGS);
+
struct manact {
- int (*cond)(DECL_ARGS); /* DON'T run actions */
- int (*pre)(DECL_ARGS); /* pre-node action */
- void (*post)(DECL_ARGS); /* post-node action */
+ int_fp cond; /* DON'T run actions */
+ int_fp pre; /* pre-node action */
+ void_fp post; /* post-node action */
const char *prefix; /* pre-node string constant */
const char *suffix; /* post-node string constant */
};
@@ -80,7 +83,7 @@ static int pre_bd(DECL_ARGS);
static int pre_bf(DECL_ARGS);
static int pre_bk(DECL_ARGS);
static int pre_bl(DECL_ARGS);
-static int pre_br(DECL_ARGS);
+static void pre_br(DECL_ARGS);
static int pre_dl(DECL_ARGS);
static int pre_en(DECL_ARGS);
static int pre_enc(DECL_ARGS);
@@ -93,13 +96,13 @@ static int pre_fd(DECL_ARGS);
static int pre_fl(DECL_ARGS);
static int pre_fn(DECL_ARGS);
static int pre_fo(DECL_ARGS);
-static int pre_ft(DECL_ARGS);
+static void pre_ft(DECL_ARGS);
static int pre_Ft(DECL_ARGS);
static int pre_in(DECL_ARGS);
static int pre_it(DECL_ARGS);
static int pre_lk(DECL_ARGS);
static int pre_li(DECL_ARGS);
-static int pre_ll(DECL_ARGS);
+static void pre_ll(DECL_ARGS);
static int pre_nm(DECL_ARGS);
static int pre_no(DECL_ARGS);
static int pre_ns(DECL_ARGS);
@@ -121,6 +124,12 @@ static void print_width(const struct mdoc_bl *,
static void print_count(int *);
static void print_node(DECL_ARGS);
+static const void_fp roff_manacts[ROFF_MAX] = {
+ pre_br,
+ pre_ft,
+ pre_ll,
+};
+
static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
{ NULL, NULL, NULL, NULL, NULL }, /* Dd */
{ NULL, NULL, NULL, NULL, NULL }, /* Dt */
@@ -243,7 +252,6 @@ static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
{ NULL, pre_sp, post_sp, NULL, NULL }, /* sp */
{ NULL, NULL, post_percent, NULL, NULL }, /* %U */
{ NULL, NULL, NULL, NULL, NULL }, /* Ta */
- { NULL, pre_ll, post_sp, NULL, NULL }, /* ll */
};
static const struct manact *const manacts = __manacts - MDOC_Dd;
@@ -653,16 +661,8 @@ print_node(DECL_ARGS)
else if (outflags & MMAN_Sm)
outflags |= MMAN_spc;
} else if (n->tok < ROFF_MAX) {
- switch (n->tok) {
- case ROFF_br:
- do_sub = pre_br(meta, n);
- break;
- case ROFF_ft:
- do_sub = pre_ft(meta, n);
- break;
- default:
- abort();
- }
+ (*roff_manacts[n->tok])(meta, n);
+ return;
} else {
assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
/*
@@ -1068,12 +1068,10 @@ post_bl(DECL_ARGS)
}
-static int
+static void
pre_br(DECL_ARGS)
{
-
outflags |= MMAN_br;
- return 0;
}
static int
@@ -1326,13 +1324,12 @@ pre_Ft(DECL_ARGS)
return 1;
}
-static int
+static void
pre_ft(DECL_ARGS)
{
print_line(".ft", 0);
print_word(n->child->string);
outflags |= MMAN_nl;
- return 0;
}
static int
@@ -1567,12 +1564,13 @@ pre_lk(DECL_ARGS)
return 0;
}
-static int
+static void
pre_ll(DECL_ARGS)
{
-
print_line(".ll", 0);
- return 1;
+ if (n->child != NULL)
+ print_word(n->child->string);
+ outflags |= MMAN_nl;
}
static int
diff --git a/mdoc_markdown.c b/mdoc_markdown.c
index 15430c44..3d6a5d66 100644
--- a/mdoc_markdown.c
+++ b/mdoc_markdown.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_markdown.c,v 1.19 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: mdoc_markdown.c,v 1.20 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -19,7 +19,6 @@
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "mandoc_aux.h"
@@ -226,7 +225,6 @@ static const struct md_act __md_acts[MDOC_MAX - MDOC_Dd] = {
{ NULL, md_pre_Pp, NULL, NULL, NULL }, /* sp */
{ NULL, md_pre_Lk, md_post_pc, NULL, NULL }, /* %U */
{ NULL, NULL, NULL, NULL, NULL }, /* Ta */
- { NULL, NULL, NULL, NULL, NULL }, /* ll */
};
static const struct md_act *const md_acts = __md_acts - MDOC_Dd;
@@ -325,11 +323,9 @@ md_node(struct roff_node *n)
case ROFF_br:
process_children = md_pre_br(n);
break;
- case ROFF_ft:
+ default:
process_children = 0;
break;
- default:
- abort();
}
} else {
assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
diff --git a/mdoc_state.c b/mdoc_state.c
index 3938f239..d0ee6c25 100644
--- a/mdoc_state.c
+++ b/mdoc_state.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_state.c,v 1.6 2017/05/04 17:48:29 schwarze Exp $ */
+/* $Id: mdoc_state.c,v 1.7 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -158,7 +158,6 @@ static const state_handler __state_handlers[MDOC_MAX - MDOC_Dd] = {
NULL, /* sp */
NULL, /* %U */
NULL, /* Ta */
- NULL, /* ll */
};
static const state_handler *const state_handlers = __state_handlers - MDOC_Dd;
diff --git a/mdoc_term.c b/mdoc_term.c
index 4718448e..e7e8a0d2 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.353 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.354 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -106,7 +106,6 @@ static int termp_ft_pre(DECL_ARGS);
static int termp_in_pre(DECL_ARGS);
static int termp_it_pre(DECL_ARGS);
static int termp_li_pre(DECL_ARGS);
-static int termp_ll_pre(DECL_ARGS);
static int termp_lk_pre(DECL_ARGS);
static int termp_nd_pre(DECL_ARGS);
static int termp_nm_pre(DECL_ARGS);
@@ -247,7 +246,6 @@ static const struct termact __termacts[MDOC_MAX - MDOC_Dd] = {
{ termp_sp_pre, NULL }, /* sp */
{ NULL, termp____post }, /* %U */
{ NULL, NULL }, /* Ta */
- { termp_ll_pre, NULL }, /* ll */
};
static const struct termact *const termacts = __termacts - MDOC_Dd;
@@ -366,8 +364,7 @@ print_mdoc_node(DECL_ARGS)
default:
if (n->tok < ROFF_MAX) {
roff_term_pre(p, n);
- chld = 0;
- break;
+ return;
}
assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
if (termacts[n->tok].pre != NULL &&
@@ -391,9 +388,7 @@ print_mdoc_node(DECL_ARGS)
case ROFFT_EQN:
break;
default:
- if (n->tok < ROFF_MAX ||
- termacts[n->tok].post == NULL ||
- n->flags & NODE_ENDED)
+ if (termacts[n->tok].post == NULL || n->flags & NODE_ENDED)
break;
(void)(*termacts[n->tok].post)(p, &npair, meta, n);
@@ -410,10 +405,8 @@ print_mdoc_node(DECL_ARGS)
if (NODE_EOS & n->flags)
p->flags |= TERMP_SENTENCE;
- if (MDOC_ll != n->tok) {
- p->offset = offset;
- p->rmargin = rmargin;
- }
+ p->offset = offset;
+ p->rmargin = rmargin;
}
static void
@@ -605,14 +598,6 @@ print_bvspace(struct termp *p,
static int
-termp_ll_pre(DECL_ARGS)
-{
-
- term_setwidth(p, n->child != NULL ? n->child->string : NULL);
- return 0;
-}
-
-static int
termp_it_pre(DECL_ARGS)
{
struct roffsu su;
diff --git a/mdoc_validate.c b/mdoc_validate.c
index f57c4e54..34028419 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.324 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.325 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -230,7 +230,6 @@ static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] = {
post_par, /* sp */
NULL, /* %U */
NULL, /* Ta */
- NULL, /* ll */
};
static const v_post *const mdoc_valids = __mdoc_valids - MDOC_Dd;
diff --git a/roff.c b/roff.c
index 654ee90e..b9967ade 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.297 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: roff.c,v 1.298 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -211,7 +211,7 @@ static enum rofferr roff_userdef(ROFF_ARGS);
#define ROFFNUM_WHITE (1 << 1) /* Skip whitespace in roff_evalnum(). */
const char *__roff_name[MAN_MAX + 1] = {
- "br", "ft", NULL,
+ "br", "ft", "ll", NULL,
"ab", "ad", "af", "aln",
"als", "am", "am1", "ami",
"ami1", "as", "as1", "asciify",
@@ -302,7 +302,7 @@ const char *__roff_name[MAN_MAX + 1] = {
"Lk", "Mt", "Brq", "Bro",
"Brc", "%C", "Es", "En",
"Dx", "%Q", "sp",
- "%U", "Ta", "ll", NULL,
+ "%U", "Ta", NULL,
"TH", "SH", "SS", "TP",
"LP", "PP", "P", "IP",
"HP", "SM", "SB", "BI",
@@ -312,13 +312,14 @@ const char *__roff_name[MAN_MAX + 1] = {
"RE", "RS", "DT", "UC",
"PD", "AT", "in",
"OP", "EX", "EE", "UR",
- "UE", "ll", NULL
+ "UE", NULL
};
const char *const *roff_name = __roff_name;
static struct roffmac roffs[TOKEN_NONE] = {
{ roff_br, NULL, NULL, 0 }, /* br */
{ roff_onearg, NULL, NULL, 0 }, /* ft */
+ { roff_onearg, NULL, NULL, 0 }, /* ll */
{ NULL, NULL, NULL, 0 }, /* ROFF_MAX */
{ roff_unsupp, NULL, NULL, 0 }, /* ab */
{ roff_line_ignore, NULL, NULL, 0 }, /* ad */
diff --git a/roff.h b/roff.h
index 928b97eb..3c0ed006 100644
--- a/roff.h
+++ b/roff.h
@@ -1,4 +1,4 @@
-/* $Id: roff.h,v 1.44 2017/05/05 02:06:19 schwarze Exp $ */
+/* $Id: roff.h,v 1.45 2017/05/05 13:17:55 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -68,6 +68,7 @@ enum roff_type {
enum roff_tok {
ROFF_br = 0,
ROFF_ft,
+ ROFF_ll,
ROFF_MAX,
ROFF_ab,
ROFF_ad,
@@ -196,7 +197,6 @@ enum roff_tok {
ROFF_lg,
ROFF_lhang,
ROFF_linetabs,
- /* MAN_ll, MDOC_ll */
ROFF_lnr,
ROFF_lnrf,
ROFF_lpfx,
@@ -432,7 +432,6 @@ enum roff_tok {
MDOC_sp,
MDOC__U,
MDOC_Ta,
- MDOC_ll,
MDOC_MAX,
MAN_TH,
MAN_SH,
@@ -469,7 +468,6 @@ enum roff_tok {
MAN_EE,
MAN_UR,
MAN_UE,
- MAN_ll,
MAN_MAX
};
diff --git a/roff_term.c b/roff_term.c
index cd9fba37..783bd2ee 100644
--- a/roff_term.c
+++ b/roff_term.c
@@ -1,6 +1,6 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2014, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <assert.h>
+#include <stddef.h>
#include "roff.h"
#include "out.h"
@@ -28,10 +29,12 @@ typedef void (*roff_term_pre_fp)(ROFF_TERM_ARGS);
static void roff_term_pre_br(ROFF_TERM_ARGS);
static void roff_term_pre_ft(ROFF_TERM_ARGS);
+static void roff_term_pre_ll(ROFF_TERM_ARGS);
static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = {
roff_term_pre_br, /* br */
roff_term_pre_ft, /* ft */
+ roff_term_pre_ll, /* ft */
};
@@ -78,3 +81,9 @@ roff_term_pre_ft(ROFF_TERM_ARGS)
break;
}
}
+
+static void
+roff_term_pre_ll(ROFF_TERM_ARGS)
+{
+ term_setwidth(p, n->child != NULL ? n->child->string : NULL);
+}
diff --git a/roff_validate.c b/roff_validate.c
index 269de1c4..4fca0406 100644
--- a/roff_validate.c
+++ b/roff_validate.c
@@ -33,6 +33,7 @@ static void roff_valid_ft(ROFF_VALID_ARGS);
static const roff_valid_fp roff_valids[ROFF_MAX] = {
NULL, /* br */
roff_valid_ft, /* ft */
+ NULL, /* ll */
};