summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-16 19:55:28 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-16 19:55:28 +0000
commit9926ea89c1f7a785e750b0118b7b4ed73b4fd2d0 (patch)
treedbad9a35492afb007b8ff5e3ad1416ed1e8ed989
parenta2605b913e645cce238389093dfa9d10cbcf7236 (diff)
downloadmandoc-9926ea89c1f7a785e750b0118b7b4ed73b4fd2d0.tar.gz
Removed MAN___: moved MAN_br to its index (comments not passed into parser).
Fix: hashtable not fully formed after removal of MDOC___.
-rw-r--r--man.c4
-rw-r--r--man.h9
-rw-r--r--man_action.c3
-rw-r--r--man_hash.c2
-rw-r--r--man_macro.c3
-rw-r--r--man_term.c8
-rw-r--r--man_validate.c3
-rw-r--r--mdoc_hash.c2
8 files changed, 16 insertions, 18 deletions
diff --git a/man.c b/man.c
index 9744cc8e..eba5fa94 100644
--- a/man.c
+++ b/man.c
@@ -24,12 +24,12 @@
#include "libman.h"
const char *const __man_macronames[MAN_MAX] = {
- "\\\"", "TH", "SH", "SS",
+ "br", "TH", "SH", "SS",
"TP", "LP", "PP", "P",
"IP", "HP", "SM", "SB",
"BI", "IB", "BR", "RB",
"R", "B", "I", "IR",
- "RI", "br", "na", "i"
+ "RI", "na", "i"
};
const char * const *man_macronames = __man_macronames;
diff --git a/man.h b/man.h
index 11bbd52a..2b31637b 100644
--- a/man.h
+++ b/man.h
@@ -19,7 +19,7 @@
#include <time.h>
-#define MAN___ 0
+#define MAN_br 0
#define MAN_TH 1
#define MAN_SH 2
#define MAN_SS 3
@@ -40,10 +40,9 @@
#define MAN_I 18
#define MAN_IR 19
#define MAN_RI 20
-#define MAN_br 21
-#define MAN_na 22
-#define MAN_i 23
-#define MAN_MAX 24
+#define MAN_na 21
+#define MAN_i 22
+#define MAN_MAX 23
enum man_type {
MAN_TEXT,
diff --git a/man_action.c b/man_action.c
index 17e060bd..3d8d784a 100644
--- a/man_action.c
+++ b/man_action.c
@@ -36,7 +36,7 @@ static int post_TH(struct man *);
static time_t man_atotime(const char *);
const struct actions man_actions[MAN_MAX] = {
- { NULL }, /* __ */
+ { NULL }, /* br */
{ post_TH }, /* TH */
{ NULL }, /* SH */
{ NULL }, /* SS */
@@ -57,7 +57,6 @@ const struct actions man_actions[MAN_MAX] = {
{ NULL }, /* I */
{ NULL }, /* IR */
{ NULL }, /* RI */
- { NULL }, /* br */
{ NULL }, /* na */
{ NULL }, /* i */
};
diff --git a/man_hash.c b/man_hash.c
index fffadea0..68ce712a 100644
--- a/man_hash.c
+++ b/man_hash.c
@@ -41,7 +41,7 @@ man_hash_alloc(void)
if (NULL == htab)
return(NULL);
- for (i = 1; i < MAN_MAX; i++) {
+ for (i = 0; i < MAN_MAX; i++) {
x = man_macronames[i][0];
assert((x >= 65 && x <= 90) ||
diff --git a/man_macro.c b/man_macro.c
index 85a7c89e..80949fae 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -28,7 +28,7 @@ static int man_args(struct man *, int,
int *, char *, char **);
static int man_flags[MAN_MAX] = {
- 0, /* __ */
+ 0, /* br */
0, /* TH */
0, /* SH */
0, /* SS */
@@ -49,7 +49,6 @@ static int man_flags[MAN_MAX] = {
FL_NLINE, /* I */
FL_NLINE, /* IR */
FL_NLINE, /* RI */
- 0, /* br */
0, /* na */
FL_NLINE, /* i */
};
diff --git a/man_term.c b/man_term.c
index 698304b7..06647420 100644
--- a/man_term.c
+++ b/man_term.c
@@ -57,7 +57,7 @@ static void post_SH(DECL_ARGS);
static void post_SS(DECL_ARGS);
static const struct termact termacts[MAN_MAX] = {
- { NULL, NULL }, /* __ */
+ { pre_PP, NULL }, /* br */
{ NULL, NULL }, /* TH */
{ pre_SH, post_SH }, /* SH */
{ pre_SS, post_SS }, /* SS */
@@ -78,7 +78,6 @@ static const struct termact termacts[MAN_MAX] = {
{ pre_I, post_I }, /* I */
{ pre_IR, NULL }, /* IR */
{ pre_RI, NULL }, /* RI */
- { pre_PP, NULL }, /* br */
{ NULL, NULL }, /* na */
{ pre_I, post_I }, /* i */
};
@@ -97,7 +96,10 @@ man_run(struct termp *p, const struct man *m)
print_head(p, man_meta(m));
p->flags |= TERMP_NOSPACE;
- print_body(p, man_node(m), man_meta(m));
+ assert(man_node(m));
+ assert(MAN_ROOT == man_node(m)->type);
+ if (man_node(m)->child)
+ print_body(p, man_node(m)->child, man_meta(m));
print_foot(p, man_meta(m));
return(1);
diff --git a/man_validate.c b/man_validate.c
index 53a8a976..703e8118 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -48,7 +48,7 @@ static v_post posts_eq0[] = { check_eq0, NULL };
static v_post posts_ge2_le5[] = { check_ge2, check_le5, NULL };
static const struct man_valid man_valids[MAN_MAX] = {
- { NULL }, /* __ */
+ { posts_eq0 }, /* br */
{ posts_ge2_le5 }, /* TH */
{ posts_ge1 }, /* SH */
{ posts_ge1 }, /* SS */
@@ -69,7 +69,6 @@ static const struct man_valid man_valids[MAN_MAX] = {
{ NULL }, /* I */
{ NULL }, /* IR */
{ NULL }, /* RI */
- { posts_eq0 }, /* br */
{ posts_eq0 }, /* na */
{ NULL }, /* i */
};
diff --git a/mdoc_hash.c b/mdoc_hash.c
index f3539195..e89fb737 100644
--- a/mdoc_hash.c
+++ b/mdoc_hash.c
@@ -46,7 +46,7 @@ mdoc_hash_alloc(void)
if (NULL == htab)
return(NULL);
- for (i = 1; i < MDOC_MAX; i++) {
+ for (i = 0; i < MDOC_MAX; i++) {
major = mdoc_macronames[i][0];
assert((major >= 65 && major <= 90) ||
major == 37);