summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cgi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cgi.c b/cgi.c
index ed0f39cc..9457fe83 100644
--- a/cgi.c
+++ b/cgi.c
@@ -940,6 +940,8 @@ pathgen(struct req *req)
return;
while (NULL != (dp = fgetln(fp, &dpsz))) {
+ if ('\n' == dp[dpsz - 1])
+ dpsz--;
req->p = mandoc_realloc(req->p,
(req->psz + 1) * sizeof(char *));
req->p[req->psz++] = mandoc_strndup(dp, dpsz);