summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-18 21:34:55 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-18 21:34:55 +0000
commitaa5e467e3ea8e58a32aa957eedcb771073825614 (patch)
tree37b824fbdfb2eb9a2ed84bd028750f9b8360a971
parent1614ab369b028b285ee2bb468f5ccc2cd9c372b7 (diff)
sync to 1.7.16: adjust centering of header lines to groff conventions
-rw-r--r--usr.bin/mandoc/man_term.c4
-rw-r--r--usr.bin/mandoc/mdoc_term.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index edb532ad915..11864c49186 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.4 2009/06/18 21:16:11 schwarze Exp $ */
+/* $Id: man_term.c,v 1.5 2009/06/18 21:34:54 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -493,7 +493,7 @@ print_head(struct termp *p, const struct man_meta *meta)
meta->title, meta->msec);
p->offset = 0;
- p->rmargin = (p->maxrmargin - strlen(buf)) / 2;
+ p->rmargin = (p->maxrmargin - strlen(buf) + 1) / 2;
p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;
term_word(p, title);
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 3b5bb9c1fbb..a451b8f9683 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.7 2009/06/18 20:16:05 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.8 2009/06/18 21:34:54 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -487,15 +487,15 @@ print_head(struct termp *p, const struct mdoc_meta *meta)
meta->title, meta->msec);
p->offset = 0;
- p->rmargin = (p->maxrmargin - strlen(buf)) / 2;
+ p->rmargin = (p->maxrmargin - strlen(buf) + 1) / 2;
p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;
term_word(p, title);
term_flushln(p);
- p->flags |= TERMP_NOLPAD | TERMP_NOSPACE;
p->offset = p->rmargin;
p->rmargin = p->maxrmargin - strlen(title);
+ p->flags |= TERMP_NOLPAD | TERMP_NOSPACE;
term_word(p, buf);
term_flushln(p);
@@ -508,8 +508,8 @@ print_head(struct termp *p, const struct mdoc_meta *meta)
term_word(p, title);
term_flushln(p);
- p->rmargin = p->maxrmargin;
p->offset = 0;
+ p->rmargin = p->maxrmargin;
p->flags &= ~TERMP_NOSPACE;
free(title);