summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-16 03:00:23 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-16 03:00:23 +0000
commitb36c2e4756f2b576b474a61019f15645f0cf8388 (patch)
tree17b05ac82abed673c1f86d4f9115be0ca4d06a85
parentc5b0120ca117dc54fa423077e5640fc89c76e334 (diff)
downloadmandoc-b36c2e4756f2b576b474a61019f15645f0cf8388.tar.gz
Remove the ENDBODY_NOSPACE flag, simplifying the code.
Comparing to groff output, it appears that all cases where it was used and made a difference actually require the opposite, ENDBODY_SPACE. I have no idea why i added it back in 2010; maybe to compensate for some other bug that has long been fixed.
-rw-r--r--libmdoc.h2
-rw-r--r--mdoc.c4
-rw-r--r--mdoc_html.c2
-rw-r--r--mdoc_macro.c6
-rw-r--r--mdoc_man.c3
-rw-r--r--mdoc_term.c8
-rw-r--r--roff.h3
7 files changed, 7 insertions, 21 deletions
diff --git a/libmdoc.h b/libmdoc.h
index 1d5b0780..d0403155 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -70,7 +70,7 @@ struct roff_node *mdoc_block_alloc(struct roff_man *, int, int,
int, struct mdoc_arg *);
void mdoc_tail_alloc(struct roff_man *, int, int, int);
struct roff_node *mdoc_endbody_alloc(struct roff_man *, int, int, int,
- struct roff_node *, enum mdoc_endbody);
+ struct roff_node *);
void mdoc_node_relink(struct roff_man *, struct roff_node *);
void mdoc_node_validate(struct roff_man *);
void mdoc_state(struct roff_man *, struct roff_node *);
diff --git a/mdoc.c b/mdoc.c
index 988e27cc..d8cdd103 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -136,7 +136,7 @@ mdoc_tail_alloc(struct roff_man *mdoc, int line, int pos, int tok)
struct roff_node *
mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, int tok,
- struct roff_node *body, enum mdoc_endbody end)
+ struct roff_node *body)
{
struct roff_node *p;
@@ -145,7 +145,7 @@ mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, int tok,
p = roff_node_alloc(mdoc, line, pos, ROFFT_BODY, tok);
p->body = body;
p->norm = body->norm;
- p->end = end;
+ p->end = ENDBODY_SPACE;
roff_node_append(mdoc, p);
mdoc->next = ROFF_NEXT_SIBLING;
return p;
diff --git a/mdoc_html.c b/mdoc_html.c
index a3c3cced..7c67d072 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -417,8 +417,6 @@ print_mdoc_node(MDOC_ARGS)
(*mdocs[n->tok].post)(meta, n, h);
if (n->end != ENDBODY_NOT)
n->body->flags |= NODE_ENDED;
- if (n->end == ENDBODY_NOSPACE)
- h->flags |= HTML_NOSPACE;
break;
}
}
diff --git a/mdoc_macro.c b/mdoc_macro.c
index b1026b63..a4730ff1 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012-2016 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012-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
@@ -420,7 +420,7 @@ find_pending(struct roff_man *mdoc, int tok, int line, int ppos,
"%s breaks %s", mdoc_macronames[tok],
mdoc_macronames[n->tok]);
mdoc_endbody_alloc(mdoc, line, ppos,
- tok, target, ENDBODY_NOSPACE);
+ tok, target);
}
}
}
@@ -634,7 +634,7 @@ blk_exp_close(MACRO_PROT_ARGS)
mdoc_macronames[later->tok]);
endbody = mdoc_endbody_alloc(mdoc, line, ppos,
- atok, body, ENDBODY_SPACE);
+ atok, body);
if (tok == MDOC_El)
itblk->flags |= NODE_ENDED | NODE_BROKEN;
diff --git a/mdoc_man.c b/mdoc_man.c
index 1d1f0f13..69cb6ecd 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -639,9 +639,6 @@ print_node(DECL_ARGS)
if (ENDBODY_NOT != n->end)
n->body->flags |= NODE_ENDED;
-
- if (ENDBODY_NOSPACE == n->end)
- outflags &= ~(MMAN_spc | MMAN_nl);
}
static int
diff --git a/mdoc_term.c b/mdoc_term.c
index b35f951d..e0d2f4cc 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -395,14 +395,6 @@ print_mdoc_node(DECL_ARGS)
*/
if (ENDBODY_NOT != n->end)
n->body->flags |= NODE_ENDED;
-
- /*
- * End of line terminating an implicit block
- * while an explicit block is still open.
- * Continue the explicit block without spacing.
- */
- if (ENDBODY_NOSPACE == n->end)
- p->flags |= TERMP_NOSPACE;
break;
}
diff --git a/roff.h b/roff.h
index d0c60f9d..0bc70333 100644
--- a/roff.h
+++ b/roff.h
@@ -75,8 +75,7 @@ enum roff_next {
*/
enum mdoc_endbody {
ENDBODY_NOT = 0,
- ENDBODY_SPACE, /* Is broken: append a space. */
- ENDBODY_NOSPACE /* Is broken: don't append a space. */
+ ENDBODY_SPACE /* Is broken: append a space. */
};
struct roff_node {