diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-22 14:31:08 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-22 14:31:08 +0000 |
commit | 29c4bdbbc24b5207d00218cdb51a021c912be0ef (patch) | |
tree | 34eaeb5b0cbbca12913e463672c0abcf5d154422 /term.c | |
parent | 30af6cdd4f3ef74c7ebef59694b573bb3509aad0 (diff) | |
download | mandoc-29c4bdbbc24b5207d00218cdb51a021c912be0ef.tar.gz |
Cleaned up validation source a bit.
Fixed `Nm' and `Nd' detection.
Added a few more terminal outputs.
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -24,6 +24,10 @@ #include <string.h> #include <unistd.h> +#ifdef __linux__ +#include <time.h> +#endif + #include "term.h" enum termstyle { @@ -46,6 +50,10 @@ static void pescape(struct termp *, static void chara(struct termp *, char); static void style(struct termp *, enum termstyle); +#ifdef __linux__ +extern size_t strlcat(char *, const char *, size_t); +extern size_t strlcpy(char *, const char *, size_t); +#endif void flushln(struct termp *p) @@ -363,7 +371,12 @@ termprint_footer(struct termp *p, const struct mdoc_meta *meta) err(1, "malloc"); tm = localtime(&meta->date); + +#ifdef __linux__ + if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm)) +#else if (NULL == strftime(buf, p->rmargin, "%B %d, %Y", tm)) +#endif err(1, "strftime"); osz = strlcpy(os, meta->os, p->rmargin); |