From 50e5e6079cf836d29fcbcd19b59c694b205d4caa Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 16 Aug 2010 09:37:58 +0000 Subject: Add \v and \h to ignored escapes. These are in the category of \s. Also made sign-less \s-style escapes be ok (this is technically against what's in the groff.7 manual, but seems pretty widespread). Noted by Thomas Jeunet as uglifying the gcc.1 manual. --- mandoc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'mandoc.c') diff --git a/mandoc.c b/mandoc.c index f63d7864..7bba8cbb 100644 --- a/mandoc.c +++ b/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.27 2010/07/25 19:05:59 joerg Exp $ */ +/* $Id: mandoc.c,v 1.28 2010/08/16 09:37:58 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -57,8 +57,6 @@ mandoc_special(char *p) /* FALLTHROUGH */ case ('w'): /* FALLTHROUGH */ - case ('v'): - /* FALLTHROUGH */ case ('S'): /* FALLTHROUGH */ case ('R'): @@ -91,13 +89,19 @@ mandoc_special(char *p) term = '\''; break; #endif + case ('h'): + /* FALLTHROUGH */ + case ('v'): + /* FALLTHROUGH */ case ('s'): if (ASCII_HYPH == *p) *p = '-'; - if ('+' == *p || '-' == *p) - p++; - i = ('s' != *(p - 1)); + i = 0; + if ('+' == *p || '-' == *p) { + p++; + i = 1; + } switch (*p++) { case ('('): @@ -110,7 +114,7 @@ mandoc_special(char *p) term = '\''; break; case ('0'): - i++; + i = 1; /* FALLTHROUGH */ default: len = 1; @@ -121,13 +125,11 @@ mandoc_special(char *p) if (ASCII_HYPH == *p) *p = '-'; if ('+' == *p || '-' == *p) { - if (i++) + if (i) return(0); p++; } - if (0 == i) - return(0); break; #if 0 case ('Y'): -- cgit v1.2.3-56-ge451