summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c1
-rw-r--r--mandoc.h1
-rw-r--r--read.c9
3 files changed, 4 insertions, 7 deletions
diff --git a/main.c b/main.c
index 75bfcead..591f3eca 100644
--- a/main.c
+++ b/main.c
@@ -168,6 +168,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"generic fatal error",
+ "not a manual",
"column syntax is inconsistent",
"NOT IMPLEMENTED: .Bd -file",
"line scope broken, syntax violated",
diff --git a/mandoc.h b/mandoc.h
index 3378518e..a86240ef 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -137,6 +137,7 @@ enum mandocerr {
MANDOCERR_FATAL, /* ===== start of fatal errors ===== */
+ MANDOCERR_NOTMANUAL, /* manual isn't really a manual */
MANDOCERR_COLUMNS, /* column syntax is inconsistent */
MANDOCERR_BADDISP, /* NOT IMPLEMENTED: .Bd -file */
MANDOCERR_SYNTLINESCOPE, /* line scope broken, syntax violated */
diff --git a/read.c b/read.c
index 357f51dc..664eeeaf 100644
--- a/read.c
+++ b/read.c
@@ -496,16 +496,11 @@ mparse_end(struct mparse *curp)
return;
}
-#if 0
- /* FIXME: NOTE a parser may not have been assigned, yet. */
-
if ( ! (curp->man || curp->mdoc)) {
- /* FIXME: make into an mandoc.h error. */
- fprintf(stderr, "%s: Not a manual\n", curp->file);
+ mandoc_msg(MANDOCERR_NOTMANUAL, curp, 1, 0, NULL);
curp->file_status = MANDOCLEVEL_FATAL;
- goto cleanup;
+ return;
}
-#endif
roff_endparse(curp->roff);
}