aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-14 13:31:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-14 13:31:20 +0000
commit7cbe6317b2a1736649bd6feceecdc891b7fce6fc (patch)
treebda68ded3934cda03e20b3c4fe0cc33817ac8c74 /mdoc_macro.c
parentae7348914a6e3613b79a674a717da0186553c7e7 (diff)
downloadmandoc-7cbe6317b2a1736649bd6feceecdc891b7fce6fc.tar.gz
mandoc-7cbe6317b2a1736649bd6feceecdc891b7fce6fc.tar.zst
mandoc-7cbe6317b2a1736649bd6feceecdc891b7fce6fc.zip
Removed remaining "1 == ppos" invocations.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 8f1b9bf5..bb5afede 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.62 2010/05/14 12:55:22 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.63 2010/05/14 13:31:20 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -888,7 +888,7 @@ in_line(MACRO_PROT_ARGS)
static int
blk_full(MACRO_PROT_ARGS)
{
- int la;
+ int la, nl;
struct mdoc_arg *arg;
struct mdoc_node *head; /* save of head macro */
struct mdoc_node *body; /* save of body macro */
@@ -900,6 +900,8 @@ blk_full(MACRO_PROT_ARGS)
enum margverr av;
char *p;
+ nl = MDOC_NEWLINE & m->flags;
+
/* Close out prior implicit scope. */
if ( ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)) {
@@ -1033,7 +1035,7 @@ blk_full(MACRO_PROT_ARGS)
head = m->last;
}
- if (1 == ppos && ! append_delims(m, line, pos, buf))
+ if (nl && ! append_delims(m, line, pos, buf))
return(0);
/* If we've already opened our body, exit now. */
@@ -1073,7 +1075,7 @@ blk_full(MACRO_PROT_ARGS)
static int
blk_part_imp(MACRO_PROT_ARGS)
{
- int la;
+ int la, nl;
enum mdoct ntok;
enum margserr ac;
char *p;
@@ -1081,6 +1083,8 @@ blk_part_imp(MACRO_PROT_ARGS)
struct mdoc_node *body; /* saved body context */
struct mdoc_node *n;
+ nl = MDOC_NEWLINE & m->flags;
+
/*
* A macro that spans to the end of the line. This is generally
* (but not necessarily) called as the first macro. The block
@@ -1156,6 +1160,8 @@ blk_part_imp(MACRO_PROT_ARGS)
* been closed by another macro (like `Oc' closing `Op'). This
* is ugly behaviour nodding its head to OpenBSD's overwhelming
* crufty use of `Op' breakage.
+ *
+ * FIXME - this should be ifdef'd OpenBSD?
*/
for (n = m->last; n; n = n->parent)
if (body == n)
@@ -1169,7 +1175,7 @@ blk_part_imp(MACRO_PROT_ARGS)
/* Standard appending of delimiters. */
- if (1 == ppos && ! append_delims(m, line, pos, buf))
+ if (nl && ! append_delims(m, line, pos, buf))
return(0);
/* Rewind scope, if applicable. */