-/* $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 <kristaps@kth.se>
*
enum merr {
ETOOLONG,
EMALLOC,
+ EUTSNAME,
ENUMFMT
};
{ 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 */
case (ETOOLONG):
p = "argument text too long";
break;
+ case (EUTSNAME):
+ p = "utsname";
+ break;
case (EMALLOC):
p = "memory exhausted";
break;
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)
*/
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)))