version 1.46, 2013/10/11 00:06:48 |
version 1.51, 2014/04/23 21:40:47 |
|
|
|
|
#include "apropos_db.h" |
#include "apropos_db.h" |
#include "mandoc.h" |
#include "mandoc.h" |
|
#include "mandoc_aux.h" |
#include "mdoc.h" |
#include "mdoc.h" |
#include "man.h" |
#include "man.h" |
#include "main.h" |
#include "main.h" |
Line 739 format(const struct req *req, const char *file) |
|
Line 740 format(const struct req *req, const char *file) |
|
return; |
return; |
} |
} |
|
|
mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL, NULL); |
mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, NULL); |
rc = mparse_readfd(mp, fd, file); |
rc = mparse_readfd(mp, fd, file); |
close(fd); |
close(fd); |
|
|
Line 753 format(const struct req *req, const char *file) |
|
Line 754 format(const struct req *req, const char *file) |
|
/*"includes=/cgi-bin/man.cgi/usr/include/%%I"*/, |
/*"includes=/cgi-bin/man.cgi/usr/include/%%I"*/, |
progname); |
progname); |
|
|
mparse_result(mp, &mdoc, &man); |
mparse_result(mp, &mdoc, &man, NULL); |
if (NULL == man && NULL == mdoc) { |
if (NULL == man && NULL == mdoc) { |
resp_baddb(); |
resp_baddb(); |
mparse_free(mp); |
mparse_free(mp); |
Line 935 pg_search(const struct req *req, char *path) |
|
Line 936 pg_search(const struct req *req, char *path) |
|
ep++; |
ep++; |
|
|
while (ep && '\0' != *ep) { |
while (ep && '\0' != *ep) { |
cp = mandoc_realloc(cp, (sz + 1) * sizeof(char *)); |
cp = mandoc_reallocarray(cp, sz + 1, sizeof(char *)); |
start = ep; |
start = ep; |
while ('\0' != *ep && ! isspace((unsigned char)*ep)) |
while ('\0' != *ep && ! isspace((unsigned char)*ep)) |
ep++; |
ep++; |
Line 1179 pathgen(DIR *dir, char *path, struct req *req) |
|
Line 1180 pathgen(DIR *dir, char *path, struct req *req) |
|
if (rc > 0) { |
if (rc > 0) { |
/* This also strips the trailing slash. */ |
/* This also strips the trailing slash. */ |
path[(int)--sz] = '\0'; |
path[(int)--sz] = '\0'; |
req->p = mandoc_realloc |
req->p = mandoc_reallocarray(req->p, |
(req->p, |
req->psz + 1, sizeof(struct paths)); |
(req->psz + 1) * sizeof(struct paths)); |
|
/* |
/* |
* Strip out the leading "./" unless we're just a ".", |
* Strip out the leading "./" unless we're just a ".", |
* in which case use an empty string as our name. |
* in which case use an empty string as our name. |