summaryrefslogtreecommitdiffstatshomepage
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
commit0e4f080bf713883177448a6da2569e86ddf857f0 (patch)
tree4a6e3082b6a89f21600f7f9c36f55e289f818c94
parent9ee387650cc4fb799e45ab0bafc60ed8435543f0 (diff)
downloadmandoc-0e4f080bf713883177448a6da2569e86ddf857f0.tar.gz
mandoc-0e4f080bf713883177448a6da2569e86ddf857f0.tar.zst
mandoc-0e4f080bf713883177448a6da2569e86ddf857f0.zip
Fix in newline.
Correct printing of N-char predefined/special strings.
-rw-r--r--main.c5
-rw-r--r--term.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/main.c b/main.c
index d2d5a869..9a52d807 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.40 2009/07/27 19:43:02 kristaps Exp $ */
+/* $Id: main.c,v 1.41 2009/07/28 10:15:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -418,7 +418,8 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp)
/* NOTE a parser may not have been assigned, yet. */
if ( ! (man || mdoc)) {
- (void)fprintf(stderr, "%s: not a manual", curp->file);
+ (void)fprintf(stderr, "%s: not a manual\n",
+ curp->file);
return(0);
}
diff --git a/term.c b/term.c
index 3ed512d2..f8bc308d 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.96 2009/07/27 13:10:08 kristaps Exp $ */
+/* $Id: term.c,v 1.97 2009/07/28 10:15:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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;
}