mdoc_macros[] array. This sometimes prevented proper warnings
about text nodes preceding the first section header.
-/* $OpenBSD: mdoc_validate.c,v 1.205 2015/04/19 14:25:05 schwarze Exp $ */
+/* $OpenBSD: mdoc_validate.c,v 1.206 2015/04/20 09:48:19 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
/* Check that we begin with a proper `Sh'. */
n = mdoc->first->child;
- while (n != NULL && mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
+ while (n != NULL && n->tok != TOKEN_NONE &&
+ mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
n = n->next;
if (n == NULL)