From: Ingo Schwarze Date: Fri, 16 Nov 2012 22:21:05 +0000 (+0000) Subject: Warn about unknown volume or arch in Dt macro arguments; X-Git-Tag: VERSION_1_12_2~100 X-Git-Url: https://git.cameronkatri.com/mandoc.git/commitdiff_plain/c2b8e63bd5246f12bff11c19407d23e1b0ed5a11 Warn about unknown volume or arch in Dt macro arguments; patch written by Nicolas Joly . --- diff --git a/mandoc.h b/mandoc.h index caa985c2..1f072963 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.104 2012/07/18 11:11:12 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.105 2012/11/16 22:21:05 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * @@ -50,6 +50,7 @@ enum mandocerr { MANDOCERR_NOTITLE, /* no title in document */ MANDOCERR_UPPERCASE, /* document title should be all caps */ MANDOCERR_BADMSEC, /* unknown manual section */ + MANDOCERR_BADVOLARCH, /* unknown manual volume or arch */ MANDOCERR_NODATE, /* date missing, using today's date */ MANDOCERR_BADDATE, /* cannot parse date, using it verbatim */ MANDOCERR_PROLOGOOO, /* prologue macros out of order */ diff --git a/mdoc_validate.c b/mdoc_validate.c index b690efbc..c356d7cb 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.189 2012/07/18 11:11:12 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.190 2012/11/16 22:21:05 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012 Ingo Schwarze @@ -2205,9 +2205,9 @@ post_dt(POST_ARGS) free(mdoc->meta.vol); mdoc->meta.vol = mandoc_strdup(cp); } else { - /* FIXME: warn about bad arch. */ cp = mdoc_a2arch(nn->string); if (NULL == cp) { + mdoc_nmsg(mdoc, nn, MANDOCERR_BADVOLARCH); free(mdoc->meta.vol); mdoc->meta.vol = mandoc_strdup(nn->string); } else diff --git a/read.c b/read.c index e837d2bd..967d8b80 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.31 2012/07/18 11:11:12 schwarze Exp $ */ +/* $Id: read.c,v 1.32 2012/11/16 22:21:05 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -95,6 +95,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "no title in document", "document title should be all caps", "unknown manual section", + "unknown manual volume or arch", "date missing, using today's date", "cannot parse date, using it verbatim", "prologue macros out of order",