=================================================================== RCS file: /cvs/mandoc/out.c,v retrieving revision 1.20 retrieving revision 1.24 diff -u -p -r1.20 -r1.24 --- mandoc/out.c 2010/07/19 07:53:40 1.20 +++ mandoc/out.c 2010/08/16 09:37:58 1.24 @@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.20 2010/07/19 07:53:40 kristaps Exp $ */ +/* $Id: out.c,v 1.24 2010/08/16 09:37:58 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * @@ -116,6 +116,7 @@ a2roffsu(const char *src, struct roffsu *dst, enum rof return(0); } + /* FIXME: do this in the caller. */ if ((dst->scale = atof(buf)) < 0) dst->scale = 0; dst->unit = unit; @@ -239,12 +240,17 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t break; } break; + case ('h'): + /* FALLTHROUGH */ + case ('v'): + /* FALLTHROUGH */ case ('s'): - if ('+' == wp[i] || '-' == wp[i]) + j = 0; + if ('+' == wp[i] || '-' == wp[i]) { i++; + j = 1; + } - j = ('s' != wp[i - 1]); - switch (wp[i++]) { case ('('): lim = 2; @@ -255,6 +261,9 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t case ('\''): term = '\''; break; + case ('0'): + j = 1; + /* FALLTHROUGH */ default: i--; lim = 1; @@ -262,13 +271,11 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t } if ('+' == wp[i] || '-' == wp[i]) { - if (j++) + if (j) return(i); i++; } - if (0 == j) - return(i); break; case ('['): *d = DECO_SPECIAL; @@ -278,7 +285,7 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *d = DECO_NOSPACE; return(i); default: - *d = DECO_SPECIAL; + *d = DECO_SSPECIAL; i--; lim = 1; break;