summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mandoc.c20
-rw-r--r--out.c17
2 files changed, 21 insertions, 16 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'):
diff --git a/out.c b/out.c
index 746d6020..15ffd5e4 100644
--- a/out.c
+++ b/out.c
@@ -240,11 +240,16 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
break;
}
break;
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
case ('s'):
- if ('+' == wp[i] || '-' == wp[i])
+ j = 0;
+ if ('+' == wp[i] || '-' == wp[i]) {
i++;
-
- j = ('s' != wp[i - 1]);
+ j = 1;
+ }
switch (wp[i++]) {
case ('('):
@@ -257,7 +262,7 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
term = '\'';
break;
case ('0'):
- j++;
+ j = 1;
/* FALLTHROUGH */
default:
i--;
@@ -266,13 +271,11 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
}
if ('+' == wp[i] || '-' == wp[i]) {
- if (j++)
+ if (j)
return(i);
i++;
}
- if (0 == j)
- return(i);
break;
case ('['):
*d = DECO_SPECIAL;