From 3df821d1852019b1d849d65ee50cbf551b92bbd6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 30 Jul 2014 20:06:36 +0000 Subject: Simplify: replace one global flag by one local variable. No functional change. --- libman.h | 3 +-- man.c | 19 +++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/libman.h b/libman.h index 02ac949b..91827987 100644 --- a/libman.h +++ b/libman.h @@ -1,4 +1,4 @@ -/* $Id: libman.h,v 1.59 2014/07/07 19:18:15 schwarze Exp $ */ +/* $Id: libman.h,v 1.60 2014/07/30 20:06:36 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * @@ -31,7 +31,6 @@ struct man { #define MAN_BLINE (1 << 2) /* Next-line block scope. */ #define MAN_ILINE (1 << 3) /* Ignored in next-line scope. */ #define MAN_LITERAL (1 << 4) /* Literal input. */ -#define MAN_BPLINE (1 << 5) #define MAN_NEWLINE (1 << 6) /* first macro/text in a line */ enum man_next next; /* where to put the next node */ struct man_node *last; /* the last parsed node */ diff --git a/man.c b/man.c index ce14a356..0d3ca7e3 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.133 2014/07/07 21:36:20 schwarze Exp $ */ +/* $Id: man.c,v 1.134 2014/07/30 20:06:36 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -478,10 +478,11 @@ man_ptext(struct man *man, int line, char *buf, int offs) static int man_pmacro(struct man *man, int ln, char *buf, int offs) { - int i, ppos; - enum mant tok; char mac[5]; struct man_node *n; + enum mant tok; + int i, ppos; + int bline; if ('"' == buf[offs]) { mandoc_msg(MANDOCERR_COMMENT_BAD, man->parse, @@ -581,14 +582,9 @@ man_pmacro(struct man *man, int ln, char *buf, int offs) man->flags &= ~MAN_BLINE; } - /* - * Save the fact that we're in the next-line for a block. In - * this way, embedded roff instructions can "remember" state - * when they exit. - */ + /* Remember whether we are in next-line scope for a block head. */ - if (MAN_BLINE & man->flags) - man->flags |= MAN_BPLINE; + bline = man->flags & MAN_BLINE; /* Call to handler... */ @@ -610,11 +606,10 @@ man_pmacro(struct man *man, int ln, char *buf, int offs) * above-parsed macro, so return. */ - if ( ! (MAN_BPLINE & man->flags)) { + if ( ! bline) { man->flags &= ~MAN_ILINE; return(1); } - man->flags &= ~MAN_BPLINE; /* * If we're in a block scope, then allow this macro to slip by -- cgit v1.2.3-56-ge451