summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 12:23:25 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 12:23:25 +0000
commitd460b17b87e787b48938270b20eb4088e5c343ab (patch)
tree327c0f9b78231c4427c0222aba82f007a6e28ba7 /action.c
parentc3f113eda71022f3ea3245ce53f3878057139149 (diff)
downloadmandoc-d460b17b87e787b48938270b20eb4088e5c343ab.tar.gz
Clean-ups & documentation.
Diffstat (limited to 'action.c')
-rw-r--r--action.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/action.c b/action.c
index c30b8f4d..dca2bd08 100644
--- a/action.c
+++ b/action.c
@@ -292,7 +292,7 @@ post_dd(struct mdoc *mdoc)
if ( ! xstrlcat(date, n->data.text.string, sz))
return(mdoc_nerr(mdoc, n, "badly-formed manual date parameter"));
- if ( ! xstrlcat(date, " ", sz))
+ if (n->next && ! xstrlcat(date, " ", sz))
return(mdoc_nerr(mdoc, n, "badly-formed manual date parameter"));
}
@@ -300,6 +300,13 @@ post_dd(struct mdoc *mdoc)
mdoc_msg(mdoc, "parsed time: %u since epoch",
mdoc->meta.date);
return(1);
+ } else if (n)
+ return(mdoc_err(mdoc, "badly-formed manual date"));
+
+ if ((mdoc->meta.date = mdoc_atotime(date))) {
+ mdoc_msg(mdoc, "parsed time: %u since epoch",
+ mdoc->meta.date);
+ return(1);
}
return(mdoc_err(mdoc, "badly-formed manual date"));