]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_term.c
Simplify condition, avoid duplicate code; no functional change.
[mandoc.git] / mdoc_term.c
index 9079a66cf0d8b41daf8c5840b6918f09cb8efc9b..8b059067021870e5a9ba1e7531ffc22ab7d35bfe 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_term.c,v 1.246 2013/05/18 17:47:47 schwarze Exp $ */
+/*     $Id: mdoc_term.c,v 1.248 2013/05/29 16:11:40 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -313,14 +313,10 @@ print_mdoc_node(DECL_ARGS)
         */
 
        if (TERMP_KEEP & p->flags || MDOC_SYNPRETTY & n->flags) {
-               if (n->prev && n->prev->line != n->line) {
+               if (n->prev ? (n->prev->line != n->line) :
+                   (n->parent && n->parent->line != n->line)) {
                        p->flags &= ~TERMP_KEEP;
                        p->flags |= TERMP_PREKEEP;
-               } else if (NULL == n->prev) {
-                       if (n->parent && n->parent->line != n->line) {
-                               p->flags &= ~TERMP_KEEP;
-                               p->flags |= TERMP_PREKEEP;
-                       }
                }
        }
 
@@ -2215,7 +2211,7 @@ static void
 termp_bk_post(DECL_ARGS)
 {
 
-       if (MDOC_BODY == n->type)
+       if (MDOC_BODY == n->type && ! (MDOC_SYNPRETTY & n->flags))
                p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
 }