diff options
Diffstat (limited to 'cgi.c')
-rw-r--r-- | cgi.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -970,8 +970,12 @@ pathgen(struct req *req) char *dp; size_t dpsz; - if (NULL == (fp = fopen("manpath.conf", "r"))) - return; + if (NULL == (fp = fopen("manpath.conf", "r"))) { + fprintf(stderr, "%s/manpath.conf: %s\n", + MAN_DIR, strerror(errno)); + pg_error_internal(); + exit(EXIT_FAILURE); + } while (NULL != (dp = fgetln(fp, &dpsz))) { if ('\n' == dp[dpsz - 1]) @@ -980,4 +984,10 @@ pathgen(struct req *req) (req->psz + 1) * sizeof(char *)); 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); + } } |