Index: gcc/libcpp/files.c
===================================================================
RCS file: /cvs/gcc/gcc/libcpp/files.c,v
retrieving revision 1.9
diff -u -p -3 -r1.9 files.c
--- gcc/libcpp/files.c 14 Feb 2005 14:43:56 -0000 1.9
+++ gcc/libcpp/files.c 20 Apr 2005 12:49:02 -0000
@@ -573,6 +574,10 @@ read_file_guts (cpp_reader *pfile, _cpp_
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
+/* For DOS we should handle DOS EOF character (0x1A, ^Z). It is
+ only done if it is really the last character of the file */
+ if (total>0 && buf[total-1]==0x1A) total--;
+
file->buffer = _cpp_convert_input (pfile, CPP_OPTION (pfile, input_charset),
buf, size, total, &file->st.st_size);
file->buffer_valid = true;
syntax highlighted by Code2HTML, v. 0.9.1