config: peek returns '\n' on EOF; handle in write

This commit is contained in:
Edward Thomson 2015-04-21 17:18:35 -04:00
parent 6dc55872a8
commit d369d71f6a

View File

@ -1423,7 +1423,7 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
while (!reader->eof) {
c = reader_peek(reader, SKIP_WHITESPACE);
if (c == '\0') { /* We've arrived at the end of the file */
if (c == '\n') { /* We've arrived at the end of the file */
break;
} else if (c == '[') { /* section header, new section begins */