summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 8614a15a..6a39419e 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1773,10 +1773,11 @@ post_sh_head(POST_ARGS)
/* 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. */