Fix #2149523 - Incorrect line number reporting in errors after parsing macros. Remove extraneous extra line in preprocessed output which would sometimes lead to error/warning messages two lines after the end of the file

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12211 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-09-10 06:08:45 +00:00
commit 122bc852f9
6 changed files with 73 additions and 9 deletions

View file

@ -221,6 +221,8 @@ String *Swig_read_file(FILE *f) {
Append(str, buffer);
}
len = Len(str);
/* Add a newline if not present on last line -- the preprocessor seems to
* rely on \n and not EOF terminating lines */
if (len) {
char *cstr = Char(str);
if (cstr[len - 1] != '\n') {