summarylogtreecommitdiffstats
path: root/preserve-args.patch
blob: 20b87d3ad9b8aea500f27fd9625a4b82bf72b4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
preserve r->args (apr_strtok is destructive in this regard). Makes
mod_autoindex work again in conjunction with directories where FormGET is
enabled.

--- mod_form.c.old      2007-03-13 15:05:13.872945000 +0100
+++ mod_form.c  2007-03-13 15:06:26.378367000 +0100
@@ -61,6 +61,7 @@
   char* pair ;
   char* last = NULL ;
   char* eq ;
+  char* a ;
   if ( ! ctx ) {
     ctx = apr_pcalloc(r->pool, sizeof(form_ctx)) ;
     ctx->delim = delim[0];
@@ -69,7 +70,8 @@
   if ( ! ctx->vars ) {
     ctx->vars = apr_table_make(r->pool, 10) ;
   }
-  for ( pair = apr_strtok(args, delim, &last) ; pair ;
+  a = apr_pstrdup(r->pool, args);
+  for ( pair = apr_strtok(a, delim, &last) ; pair ;
         pair = apr_strtok(NULL, delim, &last) ) {
     for (eq = pair ; *eq ; ++eq)
       if ( *eq == '+' )