Tidy up the generated config.c file. Use #include "opt_config.h", comment

out text after #endif line, add missing \n at end of file, only install new
config.c if it's different to the last one which preserves the timestamp.
This commit is contained in:
Peter Wemm 1996-12-26 23:40:32 +00:00
parent 808129f0fe
commit d7b025c3ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20940

View File

@ -344,11 +344,12 @@ configfile()
perror(PREFIX);
exit(2);
}
fo = fopen(p=path("config.c"),"w");
fo = fopen(p=path("config.c.new"),"w");
if(!fo) {
perror(p);
exit(2);
}
fprintf(fo,"#include \"opt_config.h\"\n");
fprintf(fo,"#ifdef INCLUDE_CONFIG_FILE \n");
fprintf(fo,"static char *config = \"\n");
fprintf(fo,"START CONFIG FILE %s\n___",PREFIX);
@ -365,9 +366,10 @@ configfile()
}
fprintf(fo,"\nEND CONFIG FILE %s\n",PREFIX);
fprintf(fo,"\";\n");
fprintf(fo,"\n#endif INCLUDE_CONFIG_FILE");
fprintf(fo,"\n#endif /* INCLUDE_CONFIG_FILE */\n");
fclose(fi);
fclose(fo);
moveifchanged(path("config.c.new"), path("config.c"));
}
/*