diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-18 10:39:21 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-18 10:39:21 +0000 |
commit | 38575369b263f3308607ea0b6845aec9d6e5981c (patch) | |
tree | 6f8cf66b7188ad754d72d5ff537b10267fd90082 /lib.c | |
parent | 5dea08c9f947ada8c649274d3e1de4decd01e2a5 (diff) |
patch-1.0.bj.lastline.1: Handle last lines in configuration files
nicely, even when they are not terminated by a \n character.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -408,6 +408,12 @@ char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line) return s; offset = ch - s - 1; } + else if (feof (fp)) + { + /* The last line of fp isn't \n terminated */ + (*line)++; + return s; + } else { /* There wasn't room for the line -- increase ``s'' */ |