version 1.33, 2011/12/15 12:18:57 |
version 1.34, 2011/12/16 08:04:34 |
|
|
pg_show(const struct req *req, char *path) |
pg_show(const struct req *req, char *path) |
{ |
{ |
struct manpaths ps; |
struct manpaths ps; |
|
size_t sz; |
char *sub; |
char *sub; |
char file[MAXPATHLEN]; |
char file[MAXPATHLEN]; |
const char *fn, *cp; |
const char *fn, *cp; |
Line 804 pg_show(const struct req *req, char *path) |
|
Line 805 pg_show(const struct req *req, char *path) |
|
goto out; |
goto out; |
} |
} |
|
|
strlcpy(file, ps.paths[vol], MAXPATHLEN); |
sz = strlcpy(file, ps.paths[vol], MAXPATHLEN); |
|
assert(sz < MAXPATHLEN); |
strlcat(file, "/mandoc.index", MAXPATHLEN); |
strlcat(file, "/mandoc.index", MAXPATHLEN); |
|
|
/* Open the index recno(3) database. */ |
/* Open the index recno(3) database. */ |
Line 833 pg_show(const struct req *req, char *path) |
|
Line 835 pg_show(const struct req *req, char *path) |
|
else if (NULL == memchr(fn, '\0', val.size - (fn - cp))) |
else if (NULL == memchr(fn, '\0', val.size - (fn - cp))) |
resp_baddb(); |
resp_baddb(); |
else { |
else { |
|
file[(int)sz] = '\0'; |
|
strlcat(file, "/", MAXPATHLEN); |
|
strlcat(file, fn, MAXPATHLEN); |
if (0 == strcmp(cp, "cat")) |
if (0 == strcmp(cp, "cat")) |
catman(req, fn + 1); |
catman(req, file); |
else |
else |
format(req, fn + 1); |
format(req, file); |
} |
} |
out: |
out: |
if (idx) |
if (idx) |