summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-07-13 23:50:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-07-13 23:50:44 +0200
commit586ccd4e874496014d82012f478c516cc002b8ae (patch)
tree1f5af28d04472da06fe92ac691fd1075c09662e1 /src/common.c
parentf52fab94485d0056d25cbe74340626265472beee (diff)
downloadxK-586ccd4e874496014d82012f478c516cc002b8ae.tar.gz
xK-586ccd4e874496014d82012f478c516cc002b8ae.tar.xz
xK-586ccd4e874496014d82012f478c516cc002b8ae.zip
Put a prolog at the top of configuration files
Later I'm going to put in there some more information about the format etc.
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c7
1 files changed, 5 insertions, 2 deletions
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++)
{