summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-11-18 10:39:21 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-11-18 10:39:21 +0000
commit38575369b263f3308607ea0b6845aec9d6e5981c (patch)
tree6f8cf66b7188ad754d72d5ff537b10267fd90082 /lib.c
parent5dea08c9f947ada8c649274d3e1de4decd01e2a5 (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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index d5ecdb0a..55049008 100644
--- a/lib.c
+++ b/lib.c
@@ -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'' */