summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-08-08 00:11:19 +0000
committerPaul Smith <psmith@gnu.org>2002-08-08 00:11:19 +0000
commitf2ceb0d68aa780e57641e50d972fac3b6e70bd58 (patch)
tree73853f27fe9a08b2ba2938057f1f3ccc51597d06 /read.c
parentbccb277dda1a4dcc6729824a7c9d544086f147c3 (diff)
downloadgunmake-f2ceb0d68aa780e57641e50d972fac3b6e70bd58.tar.gz
Incorporate some VMS fixes.
Add -B option docs. Add .VARIABLES variable. Add a few new tests. Add a new translation: Swedish
Diffstat (limited to 'read.c')
-rw-r--r--read.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/read.c b/read.c
index ec54650..6d2de07 100644
--- a/read.c
+++ b/read.c
@@ -380,7 +380,9 @@ eval_makefile (filename, flags)
reading_file = curfile;
- free(ebuf.bufstart);
+ fclose (ebuf.fp);
+
+ free (ebuf.bufstart);
return r;
}
@@ -2564,7 +2566,12 @@ readline (ebuf)
if (ferror (ebuf->fp))
pfatal_with_name (ebuf->floc.filenm);
- return nlines ? nlines : -1;
+ /* If we found some lines, return how many.
+ If we didn't, but we did find _something_, that indicates we read the last
+ line of a file with no final newline; return 1.
+ If we read nothing, we're at EOF; return -1. */
+
+ return nlines ? nlines : p == ebuf->bufstart ? -1 : 1;
}
/* Parse the next "makefile word" from the input buffer, and return info