aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/man_validate.c b/man_validate.c
index 7c10ea5f..0aa550bd 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.148 2019/03/13 18:29:18 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.149 2019/06/27 15:07:30 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -185,8 +185,7 @@ check_root(CHKARGS)
man->meta.title = mandoc_strdup("");
man->meta.msec = mandoc_strdup("");
- man->meta.date = man->quick ? mandoc_strdup("") :
- mandoc_normdate(man, NULL, n->line, n->pos);
+ man->meta.date = mandoc_normdate(man, NULL, n->line, n->pos);
}
if (man->meta.os_e &&
@@ -369,8 +368,8 @@ post_TH(CHKARGS)
/* ->TITLE<- MSEC DATE OS VOL */
n = n->child;
- if (n && n->string) {
- for (p = n->string; '\0' != *p; p++) {
+ if (n != NULL && n->string != NULL) {
+ for (p = n->string; *p != '\0'; p++) {
/* Only warn about this once... */
if (isalpha((unsigned char)*p) &&
! isupper((unsigned char)*p)) {
@@ -388,9 +387,9 @@ post_TH(CHKARGS)
/* TITLE ->MSEC<- DATE OS VOL */
- if (n)
+ if (n != NULL)
n = n->next;
- if (n && n->string)
+ if (n != NULL && n->string != NULL)
man->meta.msec = mandoc_strdup(n->string);
else {
man->meta.msec = mandoc_strdup("");
@@ -400,17 +399,16 @@ post_TH(CHKARGS)
/* TITLE MSEC ->DATE<- OS VOL */
- if (n)
+ if (n != NULL)
n = n->next;
- if (n && n->string && '\0' != n->string[0]) {
- man->meta.date = man->quick ?
- mandoc_strdup(n->string) :
- mandoc_normdate(man, n->string, n->line, n->pos);
- } else {
+ if (n != NULL && n->string != NULL && n->string[0] != '\0')
+ man->meta.date = mandoc_normdate(man,
+ n->string, n->line, n->pos);
+ else {
man->meta.date = mandoc_strdup("");
mandoc_msg(MANDOCERR_DATE_MISSING,
- n ? n->line : nb->line,
- n ? n->pos : nb->pos, "TH");
+ n == NULL ? nb->line : n->line,
+ n == NULL ? nb->pos : n->pos, "TH");
}
/* TITLE MSEC DATE ->OS<- VOL */