* 27_remove_nsl.dpatch: Remove unnecessary linking against libnsl.
[privoxy.git] / debian / patches / 28_usermanual_slash.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 28_usermanual_slash.dpatch by Roland Rosenfeld <roland@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Redirect http://p.p/user-manual (without trailing slash) to 
6 ## DP: http://p.p/user-manual/ (with trailing slash), otherwise the links
7 ## DP: will be broken (#244931).
8
9 @DPATCH@
10 diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
11 --- privoxy~/cgisimple.c
12 +++ privoxy/cgisimple.c
13 @@ -716,6 +716,11 @@
14     assert(rsp);
15     assert(parameters);
16  
17 +   if (!parameters->first) {
18 +      /* requested http://p.p/user-manual (without trailing slash) */
19 +      return cgi_redirect(rsp, CGI_PREFIX "user-manual/");
20 +   }
21 +
22     get_string_param(parameters, "file", &filename);
23     /* Check paramter for hack attempts */
24     if (filename && strchr(filename, '/'))