From 586ccd4e874496014d82012f478c516cc002b8ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 13 Jul 2014 23:50:44 +0200
Subject: Put a prolog at the top of configuration files
Later I'm going to put in there some more information about the format etc.
---
src/common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'src/common.c')
diff --git a/src/common.c b/src/common.c
index f35493f..d905929 100644
--- a/src/common.c
+++ b/src/common.c
@@ -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++)
{
--
cgit v1.2.3