-/* $Id: cgi.c,v 1.164 2018/12/30 00:49:54 schwarze Exp $ */
+/* $Id: cgi.c,v 1.167 2019/07/10 12:49:20 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze <schwarze@usta.de>
for (; *p != '\0'; p++) {
if (isalnum((unsigned char)*p) == 0 &&
strchr("-._~", *p) == NULL)
- printf("%%%02.2X", (unsigned char)*p);
+ printf("%%%2.2X", (unsigned char)*p);
else
putchar(*p);
}
memset(&conf, 0, sizeof(conf));
conf.fragment = 1;
conf.style = mandoc_strdup(CSS_DIR "/mandoc.css");
- conf.toc = 1;
usepath = strcmp(req->q.manpath, req->p[0]);
mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S",
scriptname, *scriptname == '\0' ? "" : "/",
}
/* Optional section. */
- if (strncmp(path, "man", 3) == 0) {
+ if (strncmp(path, "man", 3) == 0 || strncmp(path, "cat", 3) == 0) {
path += 3;
end = strchr(path, '/');
free(req->q.sec);