From dbface5c83837d76b73a9ba99fde1ccc3afab3d5 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 12 Jun 2012 20:21:04 +0000 Subject: Add `cc' support. This was reported by espie@ and in the TODO. Caveat: `cc' has buggy behaviour when invoked in groff(1) and followed by a line-breaking control character macro, e.g., in a -man doc, .cc | .B foo 'B foo |cc 'B foo will cause groff(1) to behave properly for `.B' but inline the macro definition for `B' when invoked with the line-breaking macro. --- mandoc.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'mandoc.c') diff --git a/mandoc.c b/mandoc.c index 3ecf56bb..420e8aa5 100644 --- a/mandoc.c +++ b/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.65 2012/05/31 22:38:16 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.66 2012/06/12 20:21:04 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012 Ingo Schwarze @@ -603,32 +603,6 @@ mandoc_eos(const char *p, size_t sz, int enclosed) return(found && !enclosed); } -/* - * Find out whether a line is a macro line or not. If it is, adjust the - * current position and return one; if it isn't, return zero and don't - * change the current position. - */ -int -mandoc_getcontrol(const char *cp, int *ppos) -{ - int pos; - - pos = *ppos; - - if ('\\' == cp[pos] && '.' == cp[pos + 1]) - pos += 2; - else if ('.' == cp[pos] || '\'' == cp[pos]) - pos++; - else - return(0); - - while (' ' == cp[pos] || '\t' == cp[pos]) - pos++; - - *ppos = pos; - return(1); -} - /* * Convert a string to a long that may not be <0. * If the string is invalid, or is less than 0, return -1. -- cgit v1.2.3