Diff
Not logged in

Differences From:

File src/cgi.c part of check-in [f66089ec43] - Untested, experimental patch for correct redirect to the /index page when only the CGI script name is specified. by drh on 2007-10-23 18:04:19. [view]

To:

File src/cgi.c part of check-in [555911dff5] - Render the header of every page using subscript. Add a setup page that for editing that subscript. by drh on 2007-11-21 03:01:40. [view]

@@ -359,8 +359,20 @@
 ** Copies are made of both the zName and zValue parameters.
 */
 void cgi_set_parameter(const char *zName, const char *zValue){
   cgi_set_parameter_nocopy(mprintf("%s",zName), mprintf("%s",zValue));
+}
+
+/*
+** Replace a parameter with a new value.
+*/
+void cgi_replace_parameter(const char *zName, const char *zValue){
+  int i;
+  for(i=0; i<nUsedQP; i++){
+    if( strcmp(aParamQP[i].zName,zName)==0 ){
+      aParamQP[i].zValue = zValue;
+    }
+  }
 }
 
 /*
 ** Add a query parameter.  The zName portion is fixed but a copy