From d369d71f6af3107eb8d47849a678a0ce45799757 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Tue, 21 Apr 2015 17:18:35 -0400 Subject: [PATCH] config: peek returns '\n' on EOF; handle in write --- src/config_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config_file.c b/src/config_file.c index 0f9141ac3..010c494eb 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -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 */