summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-12-02 19:42:48 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-12-02 19:42:48 +0000
commitdc5bdebc9f46248315208958e86c0444760fe156 (patch)
treea2e4d52a278c2a7e5aa0bfbd8a6aa6c45c211106 /usr.bin/mandoc/mdoc.c
parent584f11579d8d94c16607f306c521c432b71f80e1 (diff)
Properly initialize the manual section to a default when .Dt is missing.
Without this, we died on an assertion. Problem noted and patch provided by kristaps@.
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index f7b7b826ddd..117f587c19d 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.70 2010/12/01 22:02:29 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.71 2010/12/02 19:42:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -298,6 +298,8 @@ mdoc_macro(MACRO_PROT_ARGS)
! (MDOC_PBODY & m->flags)) {
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG))
return(0);
+ if (NULL == m->meta.msec)
+ m->meta.msec = mandoc_strdup("1");
if (NULL == m->meta.title)
m->meta.title = mandoc_strdup("UNKNOWN");
if (NULL == m->meta.vol)