version 1.41, 2009/09/25 13:03:25 |
version 1.43, 2009/10/24 05:52:13 |
Line 186 static const struct actions mdoc_actions[MDOC_MAX] = { |
|
Line 186 static const struct actions mdoc_actions[MDOC_MAX] = { |
|
{ NULL, NULL }, /* %Q */ |
{ NULL, NULL }, /* %Q */ |
{ NULL, NULL }, /* br */ |
{ NULL, NULL }, /* br */ |
{ NULL, NULL }, /* sp */ |
{ NULL, NULL }, /* sp */ |
|
{ NULL, NULL }, /* %U */ |
}; |
}; |
|
|
#define RSORD_MAX 13 |
#define RSORD_MAX 13 |
|
|
post_os(POST_ARGS) |
post_os(POST_ARGS) |
{ |
{ |
char buf[64]; |
char buf[64]; |
|
#ifndef OSNAME |
struct utsname utsname; |
struct utsname utsname; |
|
#endif |
|
|
|
/* |
|
* Setting OSNAME to be the name of the target operating system, |
|
* e.g., "OpenBSD 4.4", will result in the compile-time constant |
|
* by supplied instead of the value in uname(). |
|
*/ |
|
|
if (m->meta.os) |
if (m->meta.os) |
free(m->meta.os); |
free(m->meta.os); |
|
|
Line 530 post_os(POST_ARGS) |
|
Line 539 post_os(POST_ARGS) |
|
return(0); |
return(0); |
|
|
if (0 == buf[0]) { |
if (0 == buf[0]) { |
|
#ifdef OSNAME |
|
if (strlcat(buf, OSNAME, 64) >= 64) |
|
return(mdoc_nerr(m, n, EUTSNAME)); |
|
#else |
if (-1 == uname(&utsname)) |
if (-1 == uname(&utsname)) |
return(mdoc_nerr(m, n, EUTSNAME)); |
return(mdoc_nerr(m, n, EUTSNAME)); |
if (strlcat(buf, utsname.sysname, 64) >= 64) |
if (strlcat(buf, utsname.sysname, 64) >= 64) |
Line 538 post_os(POST_ARGS) |
|
Line 551 post_os(POST_ARGS) |
|
return(mdoc_nerr(m, n, ETOOLONG)); |
return(mdoc_nerr(m, n, ETOOLONG)); |
if (strlcat(buf, utsname.release, 64) >= 64) |
if (strlcat(buf, utsname.release, 64) >= 64) |
return(mdoc_nerr(m, n, ETOOLONG)); |
return(mdoc_nerr(m, n, ETOOLONG)); |
|
#endif |
} |
} |
|
|
if (NULL == (m->meta.os = strdup(buf))) |
if (NULL == (m->meta.os = strdup(buf))) |