summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-09-07 00:04:48 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-09-07 00:04:48 +0000
commitd84dfd0f3f627fae37aa64d023492b885dee2eb5 (patch)
tree985f7d1b0ed10c6ad2ecab279797c7dbaf153a32
parente9b079495988ca64ee62f873dbb5bee4c76d4a82 (diff)
Allow .ll in the prologue; Daniel Levai reports Slackware Linux uses this.
-rw-r--r--usr.bin/mandoc/mdoc_macro.c6
-rw-r--r--usr.bin/mandoc/mdoc_validate.c19
2 files changed, 12 insertions, 13 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index 07ab244e21f..aa845549c51 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_macro.c,v 1.98 2014/08/21 12:56:24 schwarze Exp $ */
+/* $OpenBSD: mdoc_macro.c,v 1.99 2014/09/07 00:04:47 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -206,7 +206,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ in_line_eoln, 0 }, /* sp */
{ in_line_eoln, 0 }, /* %U */
{ phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */
- { in_line_eoln, 0 }, /* ll */
+ { in_line_eoln, MDOC_PROLOGUE }, /* ll */
};
const struct mdoc_macro * const mdoc_macros = __mdoc_macros;
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index 0612989d5db..5a1e55e3c37 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.162 2014/08/19 17:28:57 schwarze Exp $ */
+/* $OpenBSD: mdoc_validate.c,v 1.163 2014/09/07 00:04:47 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1642,18 +1642,17 @@ post_root(POST_ARGS)
mdoc->meta.os = mandoc_strdup("");
}
- n = mdoc->first;
- assert(n);
-
/* Check that we begin with a proper `Sh'. */
- if (NULL == n->child)
- mandoc_msg(MANDOCERR_DOC_EMPTY, mdoc->parse,
- n->line, n->pos, NULL);
- else if (MDOC_Sh != n->child->tok)
+ n = mdoc->first->child;
+ while (n != NULL && mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
+ n = n->next;
+
+ if (n == NULL)
+ mandoc_msg(MANDOCERR_DOC_EMPTY, mdoc->parse, 0, 0, NULL);
+ else if (n->tok != MDOC_Sh)
mandoc_msg(MANDOCERR_SEC_BEFORE, mdoc->parse,
- n->child->line, n->child->pos,
- mdoc_macronames[n->child->tok]);
+ n->line, n->pos, mdoc_macronames[n->tok]);
return(1);
}