aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-01-19 16:44:50 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-01-19 16:44:50 +0000
commit66e8f935f05d1018898cee9e0c4ad713fc6b8673 (patch)
tree0e589a7384a81e59e9bb291c205fd9582ad8fd84 /man_validate.c
parent8e1caa4a243aa8682d2c7d4fb644be63c055bb5d (diff)
downloadmandoc-66e8f935f05d1018898cee9e0c4ad713fc6b8673.tar.gz
mandoc-66e8f935f05d1018898cee9e0c4ad713fc6b8673.tar.zst
mandoc-66e8f935f05d1018898cee9e0c4ad713fc6b8673.zip
Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:
without an argument, use the empty string, and always concatenate all arguments, no matter their number. This allows reducing the number of arguments of mandoc_normdate() and some other simplifications, at the same time polishing some error messages by adding the name of the macro in question.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/man_validate.c b/man_validate.c
index 0aa550bd..374793e4 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,7 +1,7 @@
-/* $Id: man_validate.c,v 1.149 2019/06/27 15:07:30 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.150 2020/01/19 16:44:50 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -185,7 +185,7 @@ check_root(CHKARGS)
man->meta.title = mandoc_strdup("");
man->meta.msec = mandoc_strdup("");
- man->meta.date = mandoc_normdate(man, NULL, n->line, n->pos);
+ man->meta.date = mandoc_normdate(NULL, NULL);
}
if (man->meta.os_e &&
@@ -401,15 +401,10 @@ post_TH(CHKARGS)
if (n != NULL)
n = n->next;
- if (n != NULL && n->string != NULL && n->string[0] != '\0')
- man->meta.date = mandoc_normdate(man,
- n->string, n->line, n->pos);
- else {
+ if (man->quick && n != NULL)
man->meta.date = mandoc_strdup("");
- mandoc_msg(MANDOCERR_DATE_MISSING,
- n == NULL ? nb->line : n->line,
- n == NULL ? nb->pos : n->pos, "TH");
- }
+ else
+ man->meta.date = mandoc_normdate(n, nb);
/* TITLE MSEC DATE ->OS<- VOL */