From 23993a2fb4797029acfb0dbf04e468b3b6e031f0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 13 Jul 2014 12:44:58 +0000 Subject: make source vs. formatted guessing a bit more robust --- usr.bin/mandoc/cgi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c index c0c1a9c77d9..fec807bf0c5 100644 --- a/usr.bin/mandoc/cgi.c +++ b/usr.bin/mandoc/cgi.c @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.10 2014/07/13 12:31:00 schwarze Exp $ */ +/* $Id: cgi.c,v 1.11 2014/07/13 12:44:57 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -764,6 +764,8 @@ format(const struct req *req, const char *file) static void resp_show(const struct req *req, const char *file) { + if ('.' == file[0] || '/' == file[1]) + file += 2; if ('c' == *file) catman(req, file); -- cgit v1.2.3