Put a prolog at the top of configuration files

Later I'm going to put in there some more information about the format etc.
This commit is contained in:
2014-07-13 23:50:44 +02:00
parent f52fab9448
commit 586ccd4e87
3 changed files with 47 additions and 26 deletions

View File

@@ -1824,8 +1824,8 @@ read_config_file (struct str_map *config, struct error **e)
}
static char *
write_default_config (const char *filename, const struct config_item *table,
struct error **e)
write_default_config (const char *filename, const char *prolog,
const struct config_item *table, struct error **e)
{
struct str path, base;
@@ -1861,6 +1861,9 @@ write_default_config (const char *filename, const struct config_item *table,
goto error;
}
if (prolog)
fputs (prolog, fp);
errno = 0;
for (; table->key != NULL; table++)
{