summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-03 16:24:18 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-03 16:24:18 +0000
commit2563c9e78c5ee0daf4204e7057cd9e7b8e7c16e0 (patch)
treeba08a70e810a4c1c88c0624095345dc0a711d660
parentfa976d0ce1ef36d6cfc730237373ffbf339d58a9 (diff)
* outside literal context in mdoc(7), handle blank lines like .Pp
* a missing NAME section in mdoc(7) need not be fatal ok deraadt@
-rw-r--r--usr.bin/mandoc/mdoc.c10
-rw-r--r--usr.bin/mandoc/mdoc_validate.c7
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 1bdf339541b..13f3683450d 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.37 2010/04/02 12:39:47 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.38 2010/04/03 16:24:17 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -596,8 +596,12 @@ parsetext(struct mdoc *m, int line, char *buf)
for (i = 0; ' ' == buf[i]; i++)
/* Skip leading whitespace. */ ;
- if ('\0' == buf[i])
- return(mdoc_perr(m, line, 0, ENOBLANK));
+ if ('\0' == buf[i]) {
+ if ( ! mdoc_pwarn(m, line, 0, ENOBLANK))
+ return(0);
+ if ( ! mdoc_elem_alloc(m, line, 0, MDOC_Pp, NULL))
+ return(0);
+ }
/*
* Break apart a free-form line into tokens. Spaces are
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index dbac32284ed..69d7a46a246 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.44 2010/04/02 12:39:47 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.45 2010/04/03 16:24:17 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1306,8 +1306,9 @@ post_sh_head(POST_ARGS)
* non-CUSTOM has a conventional order to be followed.
*/
- if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed)
- return(mdoc_nerr(mdoc, mdoc->last, ESECNAME));
+ if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed &&
+ ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME))
+ return(0);
if (SEC_CUSTOM == sec)
return(1);
if (sec == mdoc->lastnamed)