From: schwarze Date: Fri, 8 Aug 2014 15:15:27 +0000 (+0000) Subject: better name and wording for the last two non-generic errors X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f79e7afe37224dd32b550434b454036a7e3e7ebb;p=openbsd better name and wording for the last two non-generic errors --- diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 99ec23755e5..80fd8e69429 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.87 2014/08/08 15:10:14 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.88 2014/08/08 15:15:27 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -149,11 +149,11 @@ enum mandocerr { /* related to request and macro arguments */ MANDOCERR_NAMESC, /* escaped character not allowed in a name */ MANDOCERR_ARGCOUNT, /* argument count wrong */ + MANDOCERR_BL_NOTYPE, /* missing list type, using -item */ MANDOCERR_NM_NONAME, /* missing manual name, using "" */ + MANDOCERR_OS_UNAME, /* uname(3) system call failed, using UNKNOWN */ MANDOCERR_ST_BAD, /* unknown standard specifier: standard */ - MANDOCERR_UNAME, /* uname(3) system call failed */ - MANDOCERR_NUMERIC, /* request requires a numeric argument */ - MANDOCERR_BL_NOTYPE, /* missing list type, using -item */ + MANDOCERR_IT_NONUM, /* skipping request without numeric argument */ MANDOCERR_ARG_SKIP, /* skipping all arguments: macro args */ MANDOCERR_ARG_EXCESS, /* skipping excess arguments: macro ... args */ diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 35d3a14c35b..71d959f7c74 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.150 2014/08/08 15:10:15 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.151 2014/08/08 15:15:27 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -2372,7 +2372,8 @@ post_os(POST_ARGS) #else /*!OSNAME */ if (NULL == defbuf) { if (-1 == uname(&utsname)) { - mdoc_nmsg(mdoc, n, MANDOCERR_UNAME); + mandoc_msg(MANDOCERR_OS_UNAME, mdoc->parse, + n->line, n->pos, "Os"); defbuf = mandoc_strdup("UNKNOWN"); } else mandoc_asprintf(&defbuf, "%s %s", diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index 27fc14aa4de..2422c2d4f23 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.48 2014/08/08 15:10:15 schwarze Exp $ */ +/* $Id: read.c,v 1.49 2014/08/08 15:15:27 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -185,11 +185,11 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { /* related to request and macro arguments */ "escaped character not allowed in a name", "argument count wrong", + "missing list type, using -item", "missing manual name, using \"\"", + "uname(3) system call failed, using UNKNOWN", "unknown standard specifier", - "uname(3) system call failed", - "request requires a numeric argument", - "missing list type, using -item", + "skipping request without numeric argument", "skipping all arguments", "skipping excess arguments", diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 47251e4cece..cfe8b78f0c2 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.94 2014/07/07 21:35:42 schwarze Exp $ */ +/* $Id: roff.c,v 1.95 2014/08/08 15:15:27 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1754,7 +1754,7 @@ roff_it(ROFF_ARGS) len = strcspn(cp, " \t"); cp[len] = '\0'; if ((iv = mandoc_strntoi(cp, len, 10)) <= 0) { - mandoc_msg(MANDOCERR_NUMERIC, r->parse, + mandoc_msg(MANDOCERR_IT_NONUM, r->parse, ln, ppos, *bufp + 1); return(ROFF_IGN); }