aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit873dc9b1d77212924c035df9c1accfbb3a4a6a7e (patch)
tree808bfc450c8bb7abb5f7f1c1b43d0af1d149b29d
parent08e529bf9f1013c38e9f15c21bac1c75922a0d3e (diff)
downloadmandoc-873dc9b1d77212924c035df9c1accfbb3a4a6a7e.tar.gz
mandoc-873dc9b1d77212924c035df9c1accfbb3a4a6a7e.tar.zst
mandoc-873dc9b1d77212924c035df9c1accfbb3a4a6a7e.zip
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.h4
-rw-r--r--mdoc.c6
-rw-r--r--mdoc_html.c4
-rw-r--r--mdoc_macro.c8
-rw-r--r--mdoc_man.c5
-rw-r--r--mdoc_term.c10
-rw-r--r--roff.h5
7 files changed, 14 insertions, 28 deletions
diff --git a/libmdoc.h b/libmdoc.h
index 5a6cc3ed..ac152141 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.108 2015/11/07 14:01:16 schwarze Exp $ */
+/* $Id: libmdoc.h,v 1.109 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 7c3613f4..5be1e781 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.259 2017/01/28 23:30:08 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.260 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 88bab333..e8245141 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.270 2017/02/06 03:44:58 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.271 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 dedff380..a7ec6739 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_macro.c,v 1.215 2017/02/11 15:47:16 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.216 2017/02/16 03:00:23 schwarze Exp $ */
/*
* 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 1785a034..253dc7ce 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.102 2017/02/06 03:44:58 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.103 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -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 dc17de54..398fc3f5 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.343 2017/02/06 03:44:58 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.344 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 3039d4e9..b87cf132 100644
--- a/roff.h
+++ b/roff.h
@@ -1,4 +1,4 @@
-/* $Id: roff.h,v 1.39 2017/01/10 13:47:00 schwarze Exp $ */
+/* $Id: roff.h,v 1.40 2017/02/16 03:00:23 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 {