From 715d886dfd72c29355a83d45229fd6e48f85e318 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 27 Mar 2010 10:04:56 +0000 Subject: Fixed re-adjustment of scope in exiting roff instructions (libman). Added title-case check for (libman). Fixed premature closure of roff instruction scope (libman). Added documentation of ignored roff macros to man(3). --- man.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'man.c') diff --git a/man.c b/man.c index 5b72650c..9dceb790 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.54 2010/03/24 20:10:53 kristaps Exp $ */ +/* $Id: man.c,v 1.55 2010/03/27 10:04:56 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -51,6 +51,8 @@ const char *const __man_merrnames[WERRMAX] = { "literal context already open", /* WOLITERAL */ "no literal context open", /* WNLITERAL */ "invalid nesting of roff declarations", /* WROFFNEST */ + "scope in roff instructions broken", /* WROFFSCOPE */ + "document title should be uppercase", /* WTITLECASE */ }; const char *const __man_macronames[MAN_MAX] = { @@ -155,7 +157,7 @@ int man_parseln(struct man *m, int ln, char *buf) { - return('.' == *buf ? + return('.' == *buf || '\'' == *buf ? man_pmacro(m, ln, buf) : man_ptext(m, ln, buf)); } @@ -447,7 +449,7 @@ descope: if (MAN_ELINE & m->flags) { m->flags &= ~MAN_ELINE; - if ( ! man_unscope(m, m->last->parent)) + if ( ! man_unscope(m, m->last->parent, WERRMAX)) return(0); } @@ -455,7 +457,7 @@ descope: return(1); m->flags &= ~MAN_BLINE; - if ( ! man_unscope(m, m->last->parent)) + if ( ! man_unscope(m, m->last->parent, WERRMAX)) return(0); return(man_body_alloc(m, line, 0, m->last->tok)); } @@ -623,7 +625,7 @@ out: assert(MAN_BLINE & m->flags); m->flags &= ~MAN_BLINE; - if ( ! man_unscope(m, m->last->parent)) + if ( ! man_unscope(m, m->last->parent, WERRMAX)) return(0); return(man_body_alloc(m, ln, 0, m->last->tok)); -- cgit v1.2.3-56-ge451