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 | 1f3aa1eb615112fd40061f39498636b5fb649b04 (patch) | |
tree | e6207f314b58de5fce5b071e38cdbb4c4f56c73e /mandoc.c | |
parent | 6b33358f2128ab01d7d6c6f2674a0946ca2dd14d (diff) | |
download | mandoc-1f3aa1eb615112fd40061f39498636b5fb649b04.tar.gz |
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 | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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'): |