X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/65dc168510767708e266ed70c10c9e2a646424fa..476e874dadf111ce03f98d77db0a890e143168db:/mdoc_action.c?ds=sidebyside diff --git a/mdoc_action.c b/mdoc_action.c index 13ce974c..ca6a76d3 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.17 2009/06/18 20:46:19 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.20 2009/06/25 08:42:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -33,6 +33,7 @@ enum mwarn { enum merr { ETOOLONG, EMALLOC, + EUTSNAME, ENUMFMT }; @@ -89,7 +90,7 @@ const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ad */ { NULL, NULL }, /* An */ { NULL, post_ar }, /* Ar */ - { NULL, NULL }, /* Cd */ + { NULL, NULL }, /* Cd */ /* FIXME: tabs are accepted! */ { NULL, NULL }, /* Cm */ { NULL, NULL }, /* Dv */ { NULL, NULL }, /* Er */ @@ -272,6 +273,9 @@ perr(struct mdoc *m, int line, int pos, enum merr type) case (ETOOLONG): p = "argument text too long"; break; + case (EUTSNAME): + p = "utsname"; + break; case (EMALLOC): p = "memory exhausted"; break; @@ -505,7 +509,7 @@ post_os(POST_ARGS) if (0 == buf[0]) { if (-1 == uname(&utsname)) - return(mdoc_err(m, "utsname")); + return(verr(m, EUTSNAME)); if (strlcat(buf, utsname.sysname, 64) >= 64) return(verr(m, ETOOLONG)); if (strlcat(buf, " ", 64) >= 64) @@ -614,7 +618,7 @@ post_bl_width(struct mdoc *m) */ if (0 == strcmp(p, "Ds")) - width = 8; + width = 6; else if (MDOC_MAX == (tok = mdoc_hash_find(m->htab, p))) return(1); else if (0 == (width = mdoc_macro2len(tok)))