diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-16 09:37:58 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-16 09:37:58 +0000 |
commit | 50e5e6079cf836d29fcbcd19b59c694b205d4caa (patch) | |
tree | 40e4b7eb62afd5662ffe4d32a06010e30cf11675 /mandoc.c | |
parent | c75a70fe96c444404797d0ca3abc9edf5076a713 (diff) | |
download | mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.tar.gz mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.tar.zst mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.zip |
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.
Diffstat (limited to 'mandoc.c')
-rw-r--r-- | mandoc.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -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 <kristaps@bsd.lv> * @@ -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'): |