/* current file name when doing -DDUMP_CONFIG */
const char *dump_config_fn_info;
+/* file handle when doing -DDUMP_CONFIG */
+apr_file_t *out = NULL;
static void *create_info_config(apr_pool_t * p, server_rec * s)
{
if (r)
ap_rputc('0' + i % 10, r);
else
- putchar('0' + i % 10);
+ apr_file_putc('0' + i % 10, out);
}
else {
if (r)
ap_rputs(" ", r);
else
- printf(" ");
+ apr_file_printf(out, " ");
}
}
thisfn);
}
else {
- printf("# In file: %s\n", thisfn);
+ apr_file_printf(out, "# In file: %s\n", thisfn);
}
set_fn_info(r, thisfn);
}
}
else if (linenum > 0) {
for (i = 1; i <= nest; ++i)
- printf(" ");
- putchar('#');
+ apr_file_printf(out, " ");
+ apr_file_putc('#', out);
put_int_flush_right(r, linenum, 4);
- printf(":\n");
+ apr_file_printf(out, ":\n");
}
for (i = 1; i <= nest; ++i) {
if (r)
ap_rputs(" ", r);
else
- printf(" ");
+ apr_file_printf(out, " ");
}
}
ap_escape_html(r->pool, dir->directive),
ap_escape_html(r->pool, dir->args));
else
- printf("%s %s\n", dir->directive, dir->args);
+ apr_file_printf(out, "%s %s\n", dir->directive, dir->args);
}
static void mod_info_show_open(request_rec * r, const ap_directive_t * dir,
ap_escape_html(r->pool, dir->directive),
ap_escape_html(r->pool, dir->args));
else
- printf("%s %s\n", dir->directive, dir->args);
+ apr_file_printf(out, "%s %s\n", dir->directive, dir->args);
}
static void mod_info_show_close(request_rec * r, const ap_directive_t * dir,
ap_rprintf(r, "</%s></tt></dd>",
ap_escape_html(r->pool, dirname + 1));
else
- printf("</%s>\n", dirname + 1);
+ apr_file_printf(out, "</%s>\n", dirname + 1);
}
else {
if (r)
ap_rprintf(r, "/%s</tt></dd>", ap_escape_html(r->pool, dirname));
else
- printf("/%s\n", dirname);
+ apr_file_printf(out, "/%s\n", dirname);
}
}
static int check_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s)
{
- if (ap_exists_config_define("DUMP_CONFIG"))
+ if (ap_exists_config_define("DUMP_CONFIG")) {
+ apr_file_open_stdout(&out, ptemp);
mod_info_module_cmds(NULL, NULL, ap_conftree, 0, 0);
+ }
return DECLINED;
}