aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--cgi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cgi.c b/cgi.c
index cfb779c2..d1d1199e 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.151 2017/03/15 13:49:50 schwarze Exp $ */
+/* $Id: cgi.c,v 1.152 2017/03/18 16:19:11 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@usta.de>
@@ -839,7 +839,8 @@ resp_format(const struct req *req, const char *file)
conf.fragment = 1;
conf.style = mandoc_strdup(CSS_DIR "/mandoc.css");
usepath = strcmp(req->q.manpath, req->p[0]);
- mandoc_asprintf(&conf.man, "/%s%s%%N.%%S",
+ mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S",
+ scriptname, *scriptname == '\0' ? "" : "/",
usepath ? req->q.manpath : "", usepath ? "/" : "");
mparse_result(mp, &man, NULL);