=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.151 retrieving revision 1.152 diff -u -p -r1.151 -r1.152 --- mandoc/cgi.c 2017/03/15 13:49:50 1.151 +++ mandoc/cgi.c 2017/03/18 16:19:11 1.152 @@ -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 * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -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);