-/* $OpenBSD: main.c,v 1.177 2016/08/01 10:32:39 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.178 2016/08/09 15:08:15 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2016 Ingo Schwarze <schwarze@openbsd.org>
{
const char *mparse_msg;
- fprintf(stderr, "%s: %s:", getprogname(), file);
+ fprintf(stderr, "%s: %s:", getprogname(),
+ file == NULL ? "<stdin>" : file);
if (line)
fprintf(stderr, "%d:%d:", line, col + 1);
-/* $OpenBSD: mdoc_validate.c,v 1.217 2016/01/08 17:48:04 schwarze Exp $ */
+/* $OpenBSD: mdoc_validate.c,v 1.218 2016/08/09 15:08:15 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
/* The NAME should be first. */
- if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed)
+ if (sec != SEC_NAME && mdoc->lastnamed == SEC_NONE)
mandoc_vmsg(MANDOCERR_NAMESEC_FIRST, mdoc->parse,
- mdoc->last->line, mdoc->last->pos,
- "Sh %s", secnames[sec]);
+ mdoc->last->line, mdoc->last->pos, "Sh %s",
+ sec == SEC_CUSTOM ? mdoc->last->child->string :
+ secnames[sec]);
/* The SYNOPSIS gets special attention in other areas. */