Fix reading configuration files that do not end with a newline.

This commit is contained in:
Guus Sliepen 2008-10-25 18:10:08 +00:00
parent b2cee41b18
commit cb52aa0683

View file

@ -343,6 +343,11 @@ int read_config_file(avl_tree_t *config_tree, const char *fname)
buffer = xmalloc(bufsize);
for(;;) {
if(feof(fp)) {
err = 0;
break;
}
line = readline(fp, &buffer, &bufsize);
if(!line) {
@ -350,11 +355,6 @@ int read_config_file(avl_tree_t *config_tree, const char *fname)
break;
}
if(feof(fp)) {
err = 0;
break;
}
lineno++;
if(!*line || *line == '#')