summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-10-01 21:38:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-10-01 21:38:27 +0000
commit94dec931c227d0c75634cb6df92bd4c5cbc22767 (patch)
tree1dd28f2247593f50ea00196c843d89a5ec9aac32 /usr.bin
parentec83e16587ec78170349cdc7c462316148f237f2 (diff)
* need a space before .No even if it starts with a closing delimiter
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No * do not let opening delimiters fall out of the front of .Ns (from kristaps@) This fixes a few spacing issues in csh(1) and ksh(1). OK kristaps@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/html.c4
-rw-r--r--usr.bin/mandoc/mdoc_html.c11
-rw-r--r--usr.bin/mandoc/mdoc_macro.c6
-rw-r--r--usr.bin/mandoc/mdoc_term.c11
-rw-r--r--usr.bin/mandoc/term.c4
5 files changed, 18 insertions, 18 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 717664eb5c5..58778d9ffd9 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.16 2010/09/27 21:25:28 schwarze Exp $ */
+/* $Id: html.c,v 1.17 2010/10/01 21:38:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -548,6 +548,8 @@ print_text(struct html *h, const char *word)
if ( ! (h->flags & HTML_NONOSPACE))
h->flags &= ~HTML_NOSPACE;
+ h->flags &= ~HTML_IGNDELIM;
+
/*
* Note that we don't process the pipe: the parser sees it as
* punctuation, but we don't in terms of typography.
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index fb4cf6677bd..2295e26a24d 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.33 2010/09/27 21:25:28 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.34 2010/10/01 21:38:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -87,6 +87,7 @@ static int mdoc_ex_pre(MDOC_ARGS);
static void mdoc_fo_post(MDOC_ARGS);
static int mdoc_fo_pre(MDOC_ARGS);
static int mdoc_ic_pre(MDOC_ARGS);
+static int mdoc_igndelim_pre(MDOC_ARGS);
static int mdoc_in_pre(MDOC_ARGS);
static int mdoc_it_block_pre(MDOC_ARGS, enum mdoc_list,
int, struct roffsu *, struct roffsu *);
@@ -105,7 +106,6 @@ static int mdoc_nm_pre(MDOC_ARGS);
static int mdoc_ns_pre(MDOC_ARGS);
static int mdoc_pa_pre(MDOC_ARGS);
static void mdoc_pf_post(MDOC_ARGS);
-static int mdoc_pf_pre(MDOC_ARGS);
static void mdoc_quote_post(MDOC_ARGS);
static int mdoc_quote_pre(MDOC_ARGS);
static int mdoc_rs_pre(MDOC_ARGS);
@@ -195,12 +195,12 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
{NULL, NULL}, /* Eo */
{mdoc_xx_pre, NULL}, /* Fx */
{mdoc_ms_pre, NULL}, /* Ms */
- {NULL, NULL}, /* No */
+ {mdoc_igndelim_pre, NULL}, /* No */
{mdoc_ns_pre, NULL}, /* Ns */
{mdoc_xx_pre, NULL}, /* Nx */
{mdoc_xx_pre, NULL}, /* Ox */
{NULL, NULL}, /* Pc */
- {mdoc_pf_pre, mdoc_pf_post}, /* Pf */
+ {mdoc_igndelim_pre, mdoc_pf_post}, /* Pf */
{mdoc_quote_pre, mdoc_quote_post}, /* Po */
{mdoc_quote_pre, mdoc_quote_post}, /* Pq */
{NULL, NULL}, /* Qc */
@@ -1907,7 +1907,7 @@ mdoc_ms_pre(MDOC_ARGS)
/* ARGSUSED */
static int
-mdoc_pf_pre(MDOC_ARGS)
+mdoc_igndelim_pre(MDOC_ARGS)
{
h->flags |= HTML_IGNDELIM;
@@ -1920,7 +1920,6 @@ static void
mdoc_pf_post(MDOC_ARGS)
{
- h->flags &= ~HTML_IGNDELIM;
h->flags |= HTML_NOSPACE;
}
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index 6055ee4dea9..c888b17265b 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.56 2010/09/26 20:19:58 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.57 2010/10/01 21:38:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -134,8 +134,8 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Eo */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */
- { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* No */
- { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ns */
+ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* No */
+ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Ns */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */
{ blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index a4956fb0c04..b6b21717efa 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.108 2010/09/27 21:25:28 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.109 2010/10/01 21:38:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -98,6 +98,7 @@ static int termp_fl_pre(DECL_ARGS);
static int termp_fn_pre(DECL_ARGS);
static int termp_fo_pre(DECL_ARGS);
static int termp_ft_pre(DECL_ARGS);
+static int termp_igndelim_pre(DECL_ARGS);
static int termp_in_pre(DECL_ARGS);
static int termp_it_pre(DECL_ARGS);
static int termp_li_pre(DECL_ARGS);
@@ -105,7 +106,6 @@ static int termp_lk_pre(DECL_ARGS);
static int termp_nd_pre(DECL_ARGS);
static int termp_nm_pre(DECL_ARGS);
static int termp_ns_pre(DECL_ARGS);
-static int termp_pf_pre(DECL_ARGS);
static int termp_quote_pre(DECL_ARGS);
static int termp_rs_pre(DECL_ARGS);
static int termp_rv_pre(DECL_ARGS);
@@ -192,12 +192,12 @@ static const struct termact termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Eo */
{ termp_xx_pre, NULL }, /* Fx */
{ termp_bold_pre, NULL }, /* Ms */
- { NULL, NULL }, /* No */
+ { termp_igndelim_pre, NULL }, /* No */
{ termp_ns_pre, NULL }, /* Ns */
{ termp_xx_pre, NULL }, /* Nx */
{ termp_xx_pre, NULL }, /* Ox */
{ NULL, NULL }, /* Pc */
- { termp_pf_pre, termp_pf_post }, /* Pf */
+ { termp_igndelim_pre, termp_pf_post }, /* Pf */
{ termp_quote_pre, termp_quote_post }, /* Po */
{ termp_quote_pre, termp_quote_post }, /* Pq */
{ NULL, NULL }, /* Qc */
@@ -1680,7 +1680,7 @@ termp_xx_pre(DECL_ARGS)
/* ARGSUSED */
static int
-termp_pf_pre(DECL_ARGS)
+termp_igndelim_pre(DECL_ARGS)
{
p->flags |= TERMP_IGNDELIM;
@@ -1693,7 +1693,6 @@ static void
termp_pf_post(DECL_ARGS)
{
- p->flags &= ~TERMP_IGNDELIM;
p->flags |= TERMP_NOSPACE;
}
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c
index 45425eadd4c..5844a17d024 100644
--- a/usr.bin/mandoc/term.c
+++ b/usr.bin/mandoc/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.51 2010/09/23 20:22:31 schwarze Exp $ */
+/* $Id: term.c,v 1.52 2010/10/01 21:38:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -501,7 +501,7 @@ term_word(struct termp *p, const char *word)
else
p->flags |= TERMP_NOSPACE;
- p->flags &= ~TERMP_SENTENCE;
+ p->flags &= ~(TERMP_SENTENCE | TERMP_IGNDELIM);
while (*word) {
if ((ssz = strcspn(word, "\\")) > 0)