]> git.cameronkatri.com Git - mandoc.git/commitdiff
Proper leading spaces for new- and old-groff in -man -Tascii mode.
authorKristaps Dzonsons <kristaps@bsd.lv>
Mon, 10 May 2010 08:27:09 +0000 (08:27 +0000)
committerKristaps Dzonsons <kristaps@bsd.lv>
Mon, 10 May 2010 08:27:09 +0000 (08:27 +0000)
man_term.c

index f55726fb3c7800024028923290b724cf9f4e410b..e272b09e701503c0baa15c27ce0d5a3cb7e3ecda 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: man_term.c,v 1.60 2010/05/10 08:05:17 kristaps Exp $ */
+/*     $Id: man_term.c,v 1.61 2010/05/10 08:27:09 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -369,7 +369,7 @@ pre_sp(DECL_ARGS)
 
        if (0 == len)
                term_newln(p);
-       for (i = 0; i < len; i++)
+       for (i = 0; i <= len; i++)
                term_vspace(p);
 
        return(0);
@@ -710,6 +710,9 @@ pre_SH(DECL_ARGS)
                if (n->prev && MAN_SH == n->prev->tok)
                        if (NULL == n->prev->body->child)
                                break;
+               /* If the first macro, no vspae. */
+               if (NULL == n->prev)
+                       break;
                term_vspace(p);
                break;
        case (MAN_HEAD):
@@ -892,6 +895,12 @@ print_man_head(struct termp *p, const struct man_meta *m)
 
        p->rmargin = p->maxrmargin;
 
+#ifdef __OpenBSD__
+       term_vspace(p);
+       term_vspace(p);
+       term_vspace(p);
+#endif
+
        p->offset = 0;
        buf[0] = title[0] = '\0';
 
@@ -931,4 +940,13 @@ print_man_head(struct termp *p, const struct man_meta *m)
        p->rmargin = p->maxrmargin;
        p->offset = 0;
        p->flags &= ~TERMP_NOSPACE;
+
+#ifdef __OpenBSD__
+       term_vspace(p);
+       term_vspace(p);
+#else
+       term_vspace(p);
+       term_vspace(p);
+       term_vspace(p);
+#endif
 }