version 1.72, 2014/07/13 12:55:45 |
version 1.74, 2014/07/18 14:46:25 |
Line 250 http_parse(struct req *req, char *p) |
|
Line 250 http_parse(struct req *req, char *p) |
|
|
|
if (0 == strcmp(key, "query")) |
if (0 == strcmp(key, "query")) |
req->q.expr = val; |
req->q.expr = val; |
else if (0 == strcmp(key, "manpath")) |
else if (0 == strcmp(key, "manpath")) { |
|
#ifdef COMPAT_OLDURI |
|
if (0 == strncmp(val, "OpenBSD ", 8)) { |
|
val[7] = '-'; |
|
if ('C' == val[8]) |
|
val[8] = 'c'; |
|
} |
|
#endif |
req->q.manpath = val; |
req->q.manpath = val; |
else if (0 == strcmp(key, "apropos")) |
} else if (0 == strcmp(key, "apropos")) |
req->q.equal = !strcmp(val, "0"); |
req->q.equal = !strcmp(val, "0"); |
else if (0 == strcmp(key, "sec") || |
else if (0 == strcmp(key, "sec")) { |
0 == strcmp(key, "sektion")) { |
|
if (strcmp(val, "0")) |
if (strcmp(val, "0")) |
req->q.sec = val; |
req->q.sec = val; |
|
#ifdef COMPAT_OLDURI |
|
} else if (0 == strcmp(key, "sektion")) { |
|
if (strcmp(val, "0")) |
|
req->q.sec = val; |
|
#endif |
} else if (0 == strcmp(key, "arch")) { |
} else if (0 == strcmp(key, "arch")) { |
if (strcmp(val, "default")) |
if (strcmp(val, "default")) |
req->q.arch = val; |
req->q.arch = val; |
Line 959 pathgen(struct req *req) |
|
Line 970 pathgen(struct req *req) |
|
char *dp; |
char *dp; |
size_t dpsz; |
size_t dpsz; |
|
|
if (NULL == (fp = fopen("manpath.conf", "r"))) |
if (NULL == (fp = fopen("manpath.conf", "r"))) { |
return; |
fprintf(stderr, "%s/manpath.conf: %s\n", |
|
MAN_DIR, strerror(errno)); |
|
pg_error_internal(); |
|
exit(EXIT_FAILURE); |
|
} |
|
|
while (NULL != (dp = fgetln(fp, &dpsz))) { |
while (NULL != (dp = fgetln(fp, &dpsz))) { |
if ('\n' == dp[dpsz - 1]) |
if ('\n' == dp[dpsz - 1]) |
Line 968 pathgen(struct req *req) |
|
Line 983 pathgen(struct req *req) |
|
req->p = mandoc_realloc(req->p, |
req->p = mandoc_realloc(req->p, |
(req->psz + 1) * sizeof(char *)); |
(req->psz + 1) * sizeof(char *)); |
req->p[req->psz++] = mandoc_strndup(dp, dpsz); |
req->p[req->psz++] = mandoc_strndup(dp, dpsz); |
|
} |
|
|
|
if ( req->p == NULL ) { |
|
fprintf(stderr, "%s/manpath.conf is empty\n", MAN_DIR); |
|
pg_error_internal(); |
|
exit(EXIT_FAILURE); |
} |
} |
} |
} |