From 5446071aef19f3642dd874f3094605051d1e58dd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 29 Feb 2008 15:36:13 +0100 Subject: [PATCH] do not use cfg_print() to generate default configuration file: fwrite() the default one --- Makefile.am | 6 +++--- config.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5352166f..7d0ce9c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,10 +59,10 @@ CLEANFILES += defconfig.h BUILT_SOURCES += defconfig.h defconfig.h: awesomerc @echo "generating defconfig.h from awesomerc" - @echo "#define AWESOME_DEFAULT_CONFIG \\" > defconfig.h + @echo "static const char *AWESOME_DEFAULT_CONFIG = " > defconfig.h @echo -n "\"" >> defconfig.h - @$(SED) 's,\\,\\\\,g;s/$$/ \\/;s/"/\\"/g' "awesomerc" >> defconfig.h - @echo "\"" >> defconfig.h + @$(SED) 's,\\,\\\\,g;s/$$/ \\n\\/;s/"/\\"/g' "awesomerc" >> defconfig.h + @echo "\";" >> defconfig.h CLEANFILES += uicbgen.h BUILT_SOURCES += uicbgen.h diff --git a/config.c b/config.c index dcfa0122..3f1549b9 100644 --- a/config.c +++ b/config.c @@ -533,7 +533,7 @@ config_parse(const char *confpatharg) if(defconfig) { - cfg_print(cfg, defconfig); + fwrite(AWESOME_DEFAULT_CONFIG, a_strlen(AWESOME_DEFAULT_CONFIG), 1, defconfig); fclose(defconfig); } -- 2.11.4.GIT