diff options
author | Paul Smith <psmith@gnu.org> | 2002-08-08 00:11:19 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2002-08-08 00:11:19 +0000 |
commit | f2ceb0d68aa780e57641e50d972fac3b6e70bd58 (patch) | |
tree | 73853f27fe9a08b2ba2938057f1f3ccc51597d06 /read.c | |
parent | bccb277dda1a4dcc6729824a7c9d544086f147c3 (diff) | |
download | gunmake-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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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 |