do not use cfg_print() to generate default configuration file: fwrite() the default one

This commit is contained in:
Julien Danjou 2008-02-29 15:36:13 +01:00
parent 0621a33130
commit 5446071aef
2 changed files with 4 additions and 4 deletions

View File

@ -59,10 +59,10 @@ CLEANFILES += defconfig.h
BUILT_SOURCES += defconfig.h BUILT_SOURCES += defconfig.h
defconfig.h: awesomerc defconfig.h: awesomerc
@echo "generating defconfig.h from 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 @echo -n "\"" >> defconfig.h
@$(SED) 's,\\,\\\\,g;s/$$/ \\/;s/"/\\"/g' "awesomerc" >> defconfig.h @$(SED) 's,\\,\\\\,g;s/$$/ \\n\\/;s/"/\\"/g' "awesomerc" >> defconfig.h
@echo "\"" >> defconfig.h @echo "\";" >> defconfig.h
CLEANFILES += uicbgen.h CLEANFILES += uicbgen.h
BUILT_SOURCES += uicbgen.h BUILT_SOURCES += uicbgen.h

View File

@ -533,7 +533,7 @@ config_parse(const char *confpatharg)
if(defconfig) if(defconfig)
{ {
cfg_print(cfg, defconfig); fwrite(AWESOME_DEFAULT_CONFIG, a_strlen(AWESOME_DEFAULT_CONFIG), 1, defconfig);
fclose(defconfig); fclose(defconfig);
} }