version 1.211, 2016/01/04 14:44:57 |
version 1.216, 2016/03/17 21:26:26 |
Line 341 mandocdb(int argc, char *argv[]) |
|
Line 341 mandocdb(int argc, char *argv[]) |
|
|
|
#if HAVE_PLEDGE |
#if HAVE_PLEDGE |
if (pledge("stdio rpath wpath cpath fattr flock proc exec", NULL) == -1) { |
if (pledge("stdio rpath wpath cpath fattr flock proc exec", NULL) == -1) { |
perror("pledge"); |
warn("pledge"); |
return (int)MANDOCLEVEL_SYSERR; |
return (int)MANDOCLEVEL_SYSERR; |
} |
} |
#endif |
#endif |
Line 422 mandocdb(int argc, char *argv[]) |
|
Line 422 mandocdb(int argc, char *argv[]) |
|
#if HAVE_PLEDGE |
#if HAVE_PLEDGE |
if (nodb) { |
if (nodb) { |
if (pledge("stdio rpath", NULL) == -1) { |
if (pledge("stdio rpath", NULL) == -1) { |
perror("pledge"); |
warn("pledge"); |
return (int)MANDOCLEVEL_SYSERR; |
return (int)MANDOCLEVEL_SYSERR; |
} |
} |
} |
} |
Line 456 mandocdb(int argc, char *argv[]) |
|
Line 456 mandocdb(int argc, char *argv[]) |
|
#if HAVE_PLEDGE |
#if HAVE_PLEDGE |
if (!nodb) { |
if (!nodb) { |
if (pledge("stdio rpath wpath cpath fattr flock", NULL) == -1) { |
if (pledge("stdio rpath wpath cpath fattr flock", NULL) == -1) { |
perror("pledge"); |
warn("pledge"); |
exitcode = (int)MANDOCLEVEL_SYSERR; |
exitcode = (int)MANDOCLEVEL_SYSERR; |
goto out; |
goto out; |
} |
} |
|
|
* or |
* or |
* [./]cat<section>[/<arch>]/<name>.0 |
* [./]cat<section>[/<arch>]/<name>.0 |
* |
* |
* TODO: accomodate for multi-language directories. |
* TODO: accommodate for multi-language directories. |
*/ |
*/ |
static int |
static int |
treescan(void) |
treescan(void) |
Line 1134 mpages_merge(struct mparse *mp) |
|
Line 1134 mpages_merge(struct mparse *mp) |
|
man = NULL; |
man = NULL; |
sodest = NULL; |
sodest = NULL; |
|
|
mparse_open(mp, &fd, mlink->file); |
if ((fd = mparse_open(mp, mlink->file)) == -1) { |
if (fd == -1) { |
|
say(mlink->file, "&open"); |
say(mlink->file, "&open"); |
goto nextpage; |
goto nextpage; |
} |
} |
Line 1146 mpages_merge(struct mparse *mp) |
|
Line 1145 mpages_merge(struct mparse *mp) |
|
*/ |
*/ |
if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { |
if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { |
mparse_readfd(mp, fd, mlink->file); |
mparse_readfd(mp, fd, mlink->file); |
|
close(fd); |
mparse_result(mp, &man, &sodest); |
mparse_result(mp, &man, &sodest); |
} |
} |
|
|
Line 1446 parse_man(struct mpage *mpage, const struct roff_meta |
|
Line 1446 parse_man(struct mpage *mpage, const struct roff_meta |
|
char byte; |
char byte; |
size_t sz; |
size_t sz; |
|
|
if (NULL == n) |
if (n == NULL) |
return; |
return; |
|
|
/* |
/* |
Line 1458 parse_man(struct mpage *mpage, const struct roff_meta |
|
Line 1458 parse_man(struct mpage *mpage, const struct roff_meta |
|
|
|
if (n->type == ROFFT_BODY && n->tok == MAN_SH) { |
if (n->type == ROFFT_BODY && n->tok == MAN_SH) { |
body = n; |
body = n; |
assert(body->parent); |
if ((head = body->parent->head) != NULL && |
if (NULL != (head = body->parent->head) && |
(head = head->child) != NULL && |
1 == head->nchild && |
head->next == NULL && |
NULL != (head = (head->child)) && |
|
head->type == ROFFT_TEXT && |
head->type == ROFFT_TEXT && |
0 == strcmp(head->string, "NAME") && |
strcmp(head->string, "NAME") == 0 && |
NULL != body->child) { |
body->child != NULL) { |
|
|
/* |
/* |
* Suck the entire NAME section into memory. |
* Suck the entire NAME section into memory. |
Line 1697 parse_mdoc_Va(struct mpage *mpage, const struct roff_m |
|
Line 1696 parse_mdoc_Va(struct mpage *mpage, const struct roff_m |
|
if (n->type != ROFFT_ELEM && n->type != ROFFT_BODY) |
if (n->type != ROFFT_ELEM && n->type != ROFFT_BODY) |
return 0; |
return 0; |
|
|
if (n->nchild == 1 && n->child->type == ROFFT_TEXT) |
if (n->child != NULL && |
|
n->child->next == NULL && |
|
n->child->type == ROFFT_TEXT) |
return 1; |
return 1; |
|
|
cp = NULL; |
cp = NULL; |