+/*********************************************************************
+ *
+ * Function : savearg
+ *
+ * Description : Called from `load_config'. It saves each non-empty
+ * and non-comment line from config into
+ * config->proxy_args. This is used to create the
+ * show-proxy-args page. On error, frees
+ * config->proxy_args and sets it to NULL
+ *
+ * Parameters :
+ * 1 : command = config setting that was found
+ * 2 : argument = the setting's argument (if any)
+ * 3 : config = Configuration to save into.
+ *
+ * Returns : N/A
+ *
+ *********************************************************************/
+static void savearg(char *command, char *argument, struct configuration_spec * config)
+{
+ char * buf;
+ char * s;
+
+ assert(command);
+ assert(*command);
+ assert(argument);
+
+ /*
+ * Add config option name embedded in
+ * link to it's section in the user-manual
+ */
+ buf = strdup("<a href=\"");
+ string_append(&buf, config->usermanual);
+ string_append(&buf, CONFIG_HELP_PREFIX);
+ string_join (&buf, string_toupper(command));
+ string_append(&buf, "\">");
+ string_append(&buf, command);
+ string_append(&buf, "</a> ");
+
+ if (NULL == buf)
+ {
+ freez(config->proxy_args);
+ return;
+ }
+
+ if ( (NULL != argument) && ('\0' != *argument) )
+ {
+ s = html_encode(argument);
+ if (NULL == s)
+ {
+ freez(buf);
+ freez(config->proxy_args);
+ return;
+ }
+
+ if (strncmpic(argument, "http://", 7) == 0)
+ {
+ string_append(&buf, "<a href=\"");
+ string_append(&buf, s);
+ string_append(&buf, "\">");
+ string_join (&buf, s);
+ string_append(&buf, "</a>");
+ }
+ else
+ {
+ string_join (&buf, s);
+ }
+ }
+
+ string_append(&buf, "<br>\n");
+
+ string_join(&config->proxy_args, buf);
+}
+
+