=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.164 retrieving revision 1.167 diff -u -p -r1.164 -r1.167 --- mandoc/cgi.c 2018/12/30 00:49:54 1.164 +++ mandoc/cgi.c 2019/07/10 12:49:20 1.167 @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze @@ -324,7 +324,7 @@ http_encode(const char *p) 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); } @@ -869,7 +869,6 @@ resp_format(const struct req *req, const char *file) 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' ? "" : "/", @@ -1178,7 +1177,7 @@ parse_path_info(struct req *req, const char *path) } /* 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);