Return to man_validate.c CVS log | Up to [cvsweb.bsd.lv] / mandoc |
version 1.86, 2013/10/17 20:54:58 | version 1.89, 2014/03/23 11:25:26 | ||
---|---|---|---|
|
|
||
/* $Id$ */ | /* $Id$ */ | ||
/* | /* | ||
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> | * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> | ||
* Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> | * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> | ||
* | * | ||
* Permission to use, copy, modify, and distribute this software for any | * Permission to use, copy, modify, and distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | * purpose with or without fee is hereby granted, provided that the above | ||
|
|
||
#include "man.h" | #include "man.h" | ||
#include "mandoc.h" | #include "mandoc.h" | ||
#include "mandoc_aux.h" | |||
#include "libman.h" | #include "libman.h" | ||
#include "libmandoc.h" | #include "libmandoc.h" | ||
|
|
||
man->meta.title = mandoc_strdup("unknown"); | man->meta.title = mandoc_strdup("unknown"); | ||
man->meta.msec = mandoc_strdup("1"); | man->meta.msec = mandoc_strdup("1"); | ||
man->meta.date = mandoc_normdate | man->meta.date = man->quick ? mandoc_strdup("") : | ||
(man->parse, NULL, n->line, n->pos); | mandoc_normdate(man->parse, NULL, n->line, n->pos); | ||
} | } | ||
return(1); | return(1); | ||
|
|
||
post_TH(CHKARGS) | post_TH(CHKARGS) | ||
{ | { | ||
const char *p; | const char *p; | ||
int line, pos; | |||
free(man->meta.title); | free(man->meta.title); | ||
free(man->meta.vol); | free(man->meta.vol); | ||
|
|
||
free(man->meta.msec); | free(man->meta.msec); | ||
free(man->meta.date); | free(man->meta.date); | ||
line = n->line; | |||
pos = n->pos; | |||
man->meta.title = man->meta.vol = man->meta.date = | man->meta.title = man->meta.vol = man->meta.date = | ||
man->meta.msec = man->meta.source = NULL; | man->meta.msec = man->meta.source = NULL; | ||
|
|
||
if (n) | if (n) | ||
n = n->next; | n = n->next; | ||
if (n && n->string && '\0' != n->string[0]) { | if (n && n->string && '\0' != n->string[0]) { | ||
pos = n->pos; | man->meta.date = man->quick ? | ||
man->meta.date = mandoc_normdate | mandoc_strdup(n->string) : | ||
(man->parse, n->string, line, pos); | mandoc_normdate(man->parse, n->string, | ||
n->line, n->pos); | |||
} else | } else | ||
man->meta.date = mandoc_strdup(""); | man->meta.date = mandoc_strdup(""); | ||