From fc974a57cd34bcbd149a89e1e5927d795492b4aa Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Jan 2011 23:53:51 +0000 Subject: Partial cleanup of argument count validation in mdoc(7): * Do not segfault on empty .Db, .Rs, .Sm, and .St. * Let check_count() really throw the requested level, not always ERROR. * Downgrade most bad argument counts from ERROR to WARNING. * And some related internal cleanup. Looks fine to kristaps@. Note that the macros using eerr_ge1() still need to be checked at a later time; but as all the others are done, let's use what we already have. --- mandoc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mandoc.h') diff --git a/mandoc.h b/mandoc.h index c828ba94..0f28aafc 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,6 +1,6 @@ -/* $Id: mandoc.h,v 1.45 2011/01/03 13:59:21 kristaps Exp $ */ +/* $Id: mandoc.h,v 1.46 2011/01/03 23:53:51 schwarze Exp $ */ /* - * Copyright (c) 2010 Kristaps Dzonsons + * Copyright (c) 2010, 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -75,6 +75,7 @@ enum mandocerr { /* related to missing macro arguments */ MANDOCERR_MACROEMPTY, /* skipping empty macro */ + MANDOCERR_ARGCWARN, /* argument count wrong */ MANDOCERR_DISPTYPE, /* missing display type */ MANDOCERR_LISTFIRST, /* list type must come first */ MANDOCERR_NOWIDTHARG, /* tag lists require a width argument */ -- cgit v1.2.3-56-ge451