summaryrefslogtreecommitdiffstats
path: root/out.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-04-07 07:49:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-04-07 07:49:38 +0000
commite50bd5403bffd1dcb18a4d7951661de06ec86efa (patch)
tree5b18d73f2700fc7305b53e5e245b4d8a6bbc756e /out.c
parentf6dd6a8975af8d5bf3e1397a69e955666d4ee3c3 (diff)
downloadmandoc-e50bd5403bffd1dcb18a4d7951661de06ec86efa.tar.gz
Bug in printing of reserved words with form \*[xxx] fixed (found by Joerg Sonnenberger).
Diffstat (limited to 'out.c')
-rw-r--r--out.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/out.c b/out.c
index 3ec0f319..c45dc173 100644
--- a/out.c
+++ b/out.c
@@ -197,12 +197,12 @@ int
a2roffdeco(enum roffdeco *d,
const char **word, size_t *sz)
{
- int j, type, term, lim;
+ int j, offs, term, lim;
const char *wp, *sp;
*d = DECO_NONE;
wp = *word;
- type = 1;
+ offs = 0;
switch (*wp) {
case ('\0'):
@@ -236,7 +236,7 @@ a2roffdeco(enum roffdeco *d,
return(4);
case ('['):
- type = 0;
+ offs = 1;
break;
default:
@@ -344,13 +344,15 @@ a2roffdeco(enum roffdeco *d,
}
*word = ++wp;
+
for (j = 0; *wp && ']' != *wp; wp++, j++)
/* Loop... */ ;
if ('\0' == *wp)
- return(j + 1);
+ return(j + 1 + offs);
- *d = type ? DECO_SPECIAL : DECO_RESERVED;
+ *d = offs ? DECO_RESERVED : DECO_SPECIAL;
*sz = (size_t)j;
- return (j + 2);
+
+ return (j + 2 + offs);
}