summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-28 10:15:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-28 10:15:12 +0000
commitc8cf04457494ae457f83dee07e4cbebe2b439132 (patch)
tree2de6db1a095a83235e3a9e98d01b19a2459ba387 /term.c
parentff829fb63a81e275a350d4f7c781aca1acf92661 (diff)
downloadmandoc-c8cf04457494ae457f83dee07e4cbebe2b439132.tar.gz
Fix in newline.
Correct printing of N-char predefined/special strings.
Diffstat (limited to 'term.c')
-rw-r--r--term.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/term.c b/term.c
index ea52fc11..04776e4f 100644
--- a/term.c
+++ b/term.c
@@ -392,7 +392,7 @@ do_special(struct termp *p, const char *word, size_t len)
rhs = term_a2ascii(p->symtab, word, len, &sz);
if (NULL == rhs) {
-#if 1
+#if 0
fputs("Unknown special character: ", stderr);
for (i = 0; i < (int)len; i++)
fputc(word[i], stderr);
@@ -436,10 +436,11 @@ do_reserved(struct termp *p, const char *word, size_t len)
static void
do_escaped(struct termp *p, const char **word)
{
- int j;
+ int j, type;
const char *wp;
wp = *word;
+ type = 1;
if (0 == *(++wp)) {
*word = wp;
@@ -475,6 +476,7 @@ do_escaped(struct termp *p, const char **word)
*word = ++wp;
return;
case ('['):
+ type = 0;
break;
default:
do_reserved(p, wp, 1);
@@ -522,7 +524,10 @@ do_escaped(struct termp *p, const char **word)
return;
}
- do_special(p, wp - j, (size_t)j);
+ if (type)
+ do_special(p, wp - j, (size_t)j);
+ else
+ do_reserved(p, wp - j, (size_t)j);
*word = wp;
}