summaryrefslogtreecommitdiffstats
path: root/mandoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-08-16 09:37:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-08-16 09:37:58 +0000
commit1f3aa1eb615112fd40061f39498636b5fb649b04 (patch)
treee6207f314b58de5fce5b071e38cdbb4c4f56c73e /mandoc.c
parent6b33358f2128ab01d7d6c6f2674a0946ca2dd14d (diff)
downloadmandoc-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.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mandoc.c b/mandoc.c
index cca5cd9d..45051819 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -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'):