diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-16 12:23:25 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-16 12:23:25 +0000 |
commit | 323df3a1959338fcada2958ee7d4506c60067f1b (patch) | |
tree | 4ce8570e68a0fae3b66a86d4980ee151d6192010 /action.c | |
parent | a1a867fb1c1e2901c238afa76abb2f2168efca20 (diff) | |
download | mandoc-323df3a1959338fcada2958ee7d4506c60067f1b.tar.gz mandoc-323df3a1959338fcada2958ee7d4506c60067f1b.tar.zst mandoc-323df3a1959338fcada2958ee7d4506c60067f1b.zip |
Clean-ups & documentation.
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: action.c,v 1.8 2009/01/16 11:50:54 kristaps Exp $ */ +/* $Id: action.c,v 1.9 2009/01/16 12:23:25 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> * @@ -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")); |